<?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=Rs7913</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=Rs7913"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Rs7913"/>
	<updated>2026-05-15T00:56:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695832</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695832"/>
		<updated>2018-03-28T04:31:36Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Computational molecular dynamics simulations provide a simple and fast method of calculating thermodynamic properties without having to carry out practical work in the laboratory, and is especially useful when modelling systems such as biological systems, for which it may be difficult to make models in the lab. Such methods can be used to calculate diffusion coefficients of various systems. The diffusion coefficient is an important thermodynamic quantity that can be useful to consider when investigating a wide range of phenomena such as the electrolysis of some substance, to the movement of atoms or molecules (e.g. drug molecules) around the human body&amp;lt;ref&amp;gt;M. T. Ende, N. A. Peppas, &#039;&#039;J. Control. Release&#039;&#039;, 1997, &#039;&#039;&#039;48&#039;&#039;&#039;, 47-56.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Employing a Lennard-Jones model to calculate thermodynamic properties is very useful since Lennard-Jones parameters exist for many different systems, and the results obtained can be used to gain information about a wide range of systems, from a bulk metal to argon gas. In this investigation, the LAMMPS molecular dynamics package was used to model a monatomic Lennard-Jones solid, liquid and gas.&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the MSD function.&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the VACF.&lt;br /&gt;
* To rationalise the MSD functions and VACFs calculated.&lt;br /&gt;
* To compare and contrast the use of the two methods for calculating these diffusion coefficients, and determine which is a more suitable and more accurate method.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used with the forcefield set to Lennard-Jones with a cutoff of 3.2σ, and pairwise coefficients set to 1.0, 1.0. Simulations were run for a vapour (density = 0.05, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. Systems containing 8000 atoms (20x20x20 grid) and 1000000 (100x100x100 grid) were simulated in the NVT ensemble. Microsoft Excel was used to carry out subsequent data analysis on the results from the MD simulations.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system.&amp;lt;ref&amp;gt;R. Huang, I. Chavez, K. M. Taute, B. Lukić, S. Jeney, M. G. Raizen and E.-L. Florin, &#039;&#039;Nat. Phys&#039;&#039;, 2011, &#039;&#039;&#039;7&#039;&#039;&#039;, 576-580.&amp;lt;/ref&amp;gt; However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;Y. Zhu, X. Lu, J. Zhou, Y. Wang and J. Shi, &#039;&#039;Fluid Ph. Equilibria&#039;&#039;, 2002, &#039;&#039;&#039;194&#039;&#039;&#039;, 1141-1159.&amp;lt;/ref&amp;gt;, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695831</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695831"/>
		<updated>2018-03-28T04:28:08Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Computational molecular dynamics simulations provide a simple and fast method of calculating thermodynamic properties without having to carry out practical work in the laboratory, and is especially useful when modelling systems such as biological systems, for which it may be difficult to make models in the lab. Such methods can be used to calculate diffusion coefficients of various systems. The diffusion coefficient is an important thermodynamic quantity that can be useful to consider when investigating a wide range of phenomena such as the electrolysis of some substance, to the movement of atoms or molecules (e.g. drug molecules) around the human body&amp;lt;ref&amp;gt;M. T. Ende, N. A. Peppas, &#039;&#039;J. Control. Release&#039;&#039;, 1997, &#039;&#039;&#039;48&#039;&#039;&#039;, 47-56.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Employing a Lennard-Jones model to calculate thermodynamic properties is very useful since Lennard-Jones parameters exist for many different systems, and the results obtained can be used to gain information about a wide range of systems, from a bulk metal to argon gas. In this investigation, the LAMMPS molecular dynamics package was used to model a monatomic Lennard-Jones solid, liquid and gas.&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the MSD function.&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the VACF.&lt;br /&gt;
* To compare and contrast the use of the two methods for calculating these diffusion coefficients, and determine which is a more suitable and more accurate method.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used with the forcefield set to Lennard-Jones with a cutoff of 3.2σ, and pairwise coefficients set to 1.0, 1.0. Simulations were run for a vapour (density = 0.05, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. Systems containing 8000 atoms (20x20x20 grid) and 1000000 (100x100x100 grid) were simulated in the NVT ensemble. Microsoft Excel was used to carry out subsequent data analysis on the results from the MD simulations.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system.&amp;lt;ref&amp;gt;R. Huang, I. Chavez, K. M. Taute, B. Lukić, S. Jeney, M. G. Raizen and E.-L. Florin, &#039;&#039;Nat. Phys&#039;&#039;, 2011, &#039;&#039;&#039;7&#039;&#039;&#039;, 576-580.&amp;lt;/ref&amp;gt; However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;Y. Zhu, X. Lu, J. Zhou, Y. Wang and J. Shi, &#039;&#039;Fluid Ph. Equilibria&#039;&#039;, 2002, &#039;&#039;&#039;194&#039;&#039;&#039;, 1141-1159.&amp;lt;/ref&amp;gt;, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;A&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;s expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695830</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695830"/>
		<updated>2018-03-28T04:24:39Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Computational molecular dynamics simulations provide a simple and fast method of calculating thermodynamic properties without having to carry out practical work in the laboratory, and is especially useful when modelling systems such as biological systems, for which it may be difficult to make models in the lab. Such methods can be used to calculate diffusion coefficients of various systems. The diffusion coefficient is an important thermodynamic quantity that can be useful to consider when investigating a wide range of phenomena such as the electrolysis of some substance, to the movement of atoms or molecules (e.g. drug molecules) around the human body&amp;lt;ref&amp;gt;M. T. Ende, N. A. Peppas, &#039;&#039;J. Control. Release&#039;&#039;, 1997, &#039;&#039;&#039;48&#039;&#039;&#039;, 47-56.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using a Lennard-Jones model to calculate thermodynamic properties is very useful since Lennard-Jones parameters exist for many different systems, and the results obtained can be used to gain information about a wide range of systems, from a bulk metal to argon gas.&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the MSD function.&lt;br /&gt;
* To determine the diffusion coefficients for a monatomic Lennard-Jones solid, liquid and gas using the VACF.&lt;br /&gt;
* To compare and contrast the use of the two methods for calculating these diffusion coefficients, and determine which is a more suitable and more accurate method.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used with the forcefield set to Lennard-Jones with a cutoff of 3.2σ, and pairwise coefficients set to 1.0, 1.0. Simulations were run for a vapour (density = 0.05, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. Systems containing 8000 atoms (20x20x20 grid) and 1000000 (100x100x100 grid) were simulated in the NVT ensemble. Microsoft Excel was used to carry out subsequent data analysis on the results from the MD simulations.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system.&amp;lt;ref&amp;gt;R. Huang, I. Chavez, K. M. Taute, B. Lukić, S. Jeney, M. G. Raizen and E.-L. Florin, &#039;&#039;Nat. Phys&#039;&#039;, 2011, &#039;&#039;&#039;7&#039;&#039;&#039;, 576-580.&amp;lt;/ref&amp;gt; However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;Y. Zhu, X. Lu, J. Zhou, Y. Wang and J. Shi, &#039;&#039;Fluid Ph. Equilibria&#039;&#039;, 2002, &#039;&#039;&#039;194&#039;&#039;&#039;, 1141-1159.&amp;lt;/ref&amp;gt;, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;A&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;s expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695823</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695823"/>
		<updated>2018-03-28T03:53:13Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used with the forcefield set to Lennard-Jones with a cutoff of 3.2σ, and pairwise coefficients set to 1.0, 1.0. Simulations were run for a vapour (density = 0.05, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. Systems containing 8000 atoms (20x20x20 grid) and 1000000 (100x100x100 grid) were simulated in the NVT ensemble. Microsoft Excel was used to carry out subsequent data analysis on the results from the MD simulations.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot;&amp;gt;Y. Zhu, X. Lu, J. Zhou, Y. Wang and J. Shi, &#039;&#039;Fluid Ph. Equilibria&#039;&#039;, 2002, &#039;&#039;&#039;194&#039;&#039;&#039;, 1141-1159.&amp;lt;/ref&amp;gt;, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;A&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;s expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt;, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected&amp;lt;ref name=&amp;quot;:1&amp;quot; /&amp;gt; in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695821</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695821"/>
		<updated>2018-03-28T03:37:21Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used with the forcefield set to Lennard-Jones with a cutoff of 3.2σ, and pairwise coefficients set to 1.0, 1.0. Simulations were run for a vapour (density = 0.05, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8, initialised as a sc lattice)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. Systems containing 8000 atoms (20x20x20 grid) and 1000000 (100x100x100 grid) were simulated in the NVT ensemble. Microsoft Excel was used to carry out subsequent data analysis on the results from the MD simulations.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695820</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695820"/>
		<updated>2018-03-28T03:23:17Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and appropriate use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695819</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695819"/>
		<updated>2018-03-28T03:21:35Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and suitable use of the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695818</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695818"/>
		<updated>2018-03-28T03:20:03Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695817</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695817"/>
		<updated>2018-03-28T03:18:13Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695816</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695816"/>
		<updated>2018-03-28T03:16:59Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the velocity autocorrelation function to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
The LAMMPS molecular dynamics package was used to determine the mean squared displacement (MSD) and velocity autocorrelation functions (VACF) for a monatomic Lennard-Jones solid, liquid and gas, from which the corresponding diffusion coefficients were calculated. Whilst both methods gave rise to similar relative diffusion coefficients for the solid, liquid and gaseous systems, the absolute values given by the two methods differed by between six and ten orders of magnitude when comparing the results obtained using the two different functions to modelling the same system. It is suspected that using the MSD results in a more accurate estimation of diffusion coefficient due to the additional source of error when using the VACFs to do so, which is the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms (see Figure 4), the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Whilst using both the MSD and VACF functions to calculate the diffusion coefficients for a monatomic system of a Lennard-Jones solid, liquid and gas will result in reasonable relative values of D for the solid, liquid and gaseous systems when considering one method at a time, there are some flaws. Using the MSD functions to calculate the diffusion coefficients resulted in absolute values that were around six orders of magnitude smaller than those same diffusion coefficients calculated using the VACFs. This discrepancy is far too great to be considered as negligible, and it would be useful to look at the Lennard-Jones parameters for some monatomic systems and see how the diffusion coefficients calculated actually compare to those determined by practical investigation in the lab. Such an investigation would allow for a definitive answer as to which method is more accurate for calculating the diffusion coefficient, as well as how the size of the system simulated, N, affects the accuracy of the estimated diffusion coefficients. Indeed, varying the timestep and duration of the simulation, as well examining systems even larger than 1000000 atoms, would also be useful subjects of further research.&lt;br /&gt;
&lt;br /&gt;
Whilst it cannot be definitively concluded which method is better for calculating the diffusion coefficient for a monatomic Lennard-Jones system based solely on the investigation carried out here, it would be expected that using the MSD functions would result in the more accurate results. This is because use of the trapezium rule to calculate the VACF integrals is an additional source of error that does not apply to use of the MSD functions to calculate diffusion coefficients, and likely gives rise to significant error in the calculations carried out.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695815</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695815"/>
		<updated>2018-03-28T02:25:21Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the velocity autocorrelation function to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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 trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695814</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695814"/>
		<updated>2018-03-28T02:23:38Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5 (left): Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6 (right): Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695813</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695813"/>
		<updated>2018-03-28T02:20:37Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 5: Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms. Figure 6: Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.&#039;&#039;&#039;&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|538x538px|thumb|Figure 5: Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms.]]&lt;br /&gt;
[[File:VACF_Running_Integral_N=1000000_RS7913.png|left|thumb|538x538px|Figure 6: Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695812</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695812"/>
		<updated>2018-03-28T02:15:02Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the velocity autocorrelation function to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|538x538px|thumb|Figure 5: Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms.]]&lt;br /&gt;
[[File:VACF_Running_Integral_N=1000000_RS7913.png|left|thumb|538x538px|Figure 6: Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figures 5 and 6, in all cases the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695811</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695811"/>
		<updated>2018-03-28T02:12:07Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the mean squared displacement to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the MSD functions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|560x560px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|560x560px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|538x538px|thumb|Figure 5: Running integrals for the solid, liquid and gas simulations carried out with N set to 8000 atoms.]]&lt;br /&gt;
[[File:VACF_Running_Integral_N=1000000_RS7913.png|left|thumb|538x538px|Figure 6: Running integrals for the solid, liquid and gas simulations carried out with N set to 1000000 atoms.]]&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1: Diffusion coefficients calculated using the VACFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695810</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695810"/>
		<updated>2018-03-28T01:56:42Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, as would be expected for the random Brownian motion in the system. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account - the diffusive regime - from around timestep 2250 onwards. Since this part of the function corresponds to the true random motion of particles in the system, it can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Table 1: Diffusion coefficients calculated using the MSD functions.&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|550x550px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|550x550px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695808</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695808"/>
		<updated>2018-03-28T01:39:49Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|550x550px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|550x550px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695806</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695806"/>
		<updated>2018-03-28T01:37:12Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the velocity autocorrelation function to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation. However, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic &#039;vibrations&#039; in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 5000) for the Lennard-Jones solid, liquid and gaseous simulations carried out with N set to 8000 and 1000000 atoms in Figures 3 and 4, respectively.&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|550x550px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|550x550px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0. Three weak oscillations can be seen in the VACF of the Lennard-Jones liquid, and this is due to a similar collision of atoms forwards and backwards as in the solid, but in this case is caused by the short-range order in the liquid.&lt;br /&gt;
&lt;br /&gt;
For the 1000000-atom liquid and solid simulations, it can be seen that the VACF decays to a constant value of 1, however the corresponding VACFs for the 8000-atom simulation continually fluctuates by a small amount throughout the course of the simulation, even once the function has decayed. This may indicate that an 8000-atom simulation is not sufficiently large for calculation of an adequately accurate VACF for a monatomic Lennard-Jones solid or liquid.&lt;br /&gt;
&lt;br /&gt;
It takes considerably longer for the VACF to decay to the constant value of 0 in the gaseous simulation in comparison to that of the solid and liquid, for which the VACF decays quite quickly, due to the far lower density of the gas.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer, as can be seen in Figures 3 and 4. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695802</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695802"/>
		<updated>2018-03-28T01:19:14Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
[[File:VACF Vs Timestep N = 8000 RS7913.png|left|thumb|550x550px|Figure 3: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 8000.]]&lt;br /&gt;
[[File:VACF Vs Timestep N = 1000000 RS7913.png|left|thumb|550x550px|Figure 4: VACF as a function of timestep for the solid, liquid and gaseous simulations carried out with N set to 1000000.]]&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_Vs_Timestep_N_%3D_1000000_RS7913.png&amp;diff=695801</id>
		<title>File:VACF Vs Timestep N = 1000000 RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_Vs_Timestep_N_%3D_1000000_RS7913.png&amp;diff=695801"/>
		<updated>2018-03-28T01:15:14Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_Vs_Timestep_N_%3D_8000_RS7913.png&amp;diff=695800</id>
		<title>File:VACF Vs Timestep N = 8000 RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_Vs_Timestep_N_%3D_8000_RS7913.png&amp;diff=695800"/>
		<updated>2018-03-28T01:13:14Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695799</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695799"/>
		<updated>2018-03-28T01:05:24Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the mean squared displacement to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations, with the linear fits shown.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|700x700px|thumb|Figure 2: MSD as a function of timestep for the liquid simulations, with the linear fits shown.]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|700x700px|thumb|Figure 3: MSD as a function of timestep for the solid simulations, with the linear fits shown.]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695798</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695798"/>
		<updated>2018-03-28T01:04:11Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the mean squared displacement to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|700x700px|Figure 1: MSD as a function of timestep for the gas simulations.|thumb]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695797</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695797"/>
		<updated>2018-03-28T01:03:45Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Using the mean squared displacement to calculate the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 were plotted, and a linear fit has been applied to each of these functions.[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px|Figure 1: MSD as a function of timestep for the gas simulations.]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695795</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695795"/>
		<updated>2018-03-28T00:54:34Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Using the mean squared displacement to calculate the diffusion coefficient ===&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
=== Using the velocity autocorrelation function to calculate the diffusion coefficient ===&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles in the system corresponds to random Brownian motion, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which can be thought of as anisotropic vibrations in the system due to molecules in the ordered FCC lattice colliding backwards and forwards with one another over and over again, spreading the kinetic energy over the whole solid until equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low that the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by considering the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some oscillations backwards and forwards at the beginning of the simulation as mentioned. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. A larger-scale simulation of some system containing a greater number of particles will of course inherently result in better statistical information in each frame assessed compared to a smaller-scale simulation containing fewer particles. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695794</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695794"/>
		<updated>2018-03-28T00:23:29Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low, resulting in the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by taking the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the diffusion coefficient is greatest for the gas and lowest for the liquid. The diffusion coefficient for the gas is just under one and a half orders of magnitude greater than that of the liquid, and roughly six orders of magnitude greater than that for the solid.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
In all cases, the running integral converges to a constant value over the duration of the simulation, as expected. It takes considerably longer for this to occur in the gaseous simulation in comparison to that of the solid and liquid, for which the running integral converges quite quickly. This is due to the far lower density of the gas meaning the frequency of collisions in the system is much lower than that in the case of the solid and liquid simulations, therefore the time taken for the kinetic energy to be evenly distributed over all atoms in the system is far greater, thus the time taken for the VACF to decay to the constant value of 0 is considerably longer. Indeed, in the case of the gaseous simulation with N set to 1000000 atoms, the VACF had not fully decayed within the timeframe of the simulation, therefore the running integral had not completely converged. Hence, would be worthwhile to repeat this particular simulation for a slightly longer duration to gain more accurate information in terms of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the diffusion coefficient (D) for the gas is just under 2 orders of magnitude greater than that of the liquid, and roughly four and a half orders of magnitude greater than that for the solid. This relative trend is what would be expected in terms of D for a solid, liquid and gas, and is somewhat similar to that calculated using the MSD, however the absolute values of D calculated using the VACFs are far greater than those calculated using the MSDs. Use of the trapezium rule (underestimates the area under maxima and overestimates the area under minima in a graph) when using the VACFs to calculate diffusion coefficients is an additional source of error that arises that is not a factor when using the MSD to calculate D, and could likely be the greatest source of error when estimating diffusion coefficients from the VACFs. Other sources of error in the estimations of D carried out could be use of the Lennard-Jones cutoff of 3σ, however this cutoff is quite standard when carrying out these kinds of simulations in research, and usually results in relatively accurate simulations of model systems in the literature. In addition, it is important that the Lennard-Jones model is indeed a good enough model for the system under investigation, otherwise the results obtained would not be appropriate. It is worth noting that these last two potential sources of error concerning the Lennard-Jones cutoff and using the Lennard-Jones model itself is applicable to both calculations of D using the MSD and VACF methods.&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695788</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695788"/>
		<updated>2018-03-27T23:38:23Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low, resulting in the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by taking the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated (i.e. opposite) to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities (at timestep 0). When the VACF is equal to the that at the initial timestep (timestep = 0), e.g. when C(τ) = 1 in the case of the 1D harmonic oscillator, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities, hence the VACF doesn&#039;t decay to a constant value, C(τ) = 0.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is more pronounced than that for the liquid simulation because the atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided. The minimum for the solid system also occurs more quickly (i.e. at an earlier timestep) in comparison to the liquid simulation, and this may be attributed to the greater density of the solid system resulting in more frequent collisions and therefore all of the particles having collided in a shorter timeframe. Also, a number of oscillations can be seen in the VACF of the Lennard-Jones solid, and this corresponds to the velocities of the atoms in the system fluctuating between being positively and negatively correlated to their initial velocities. This can essentially be thought of as the atoms in the system &#039;vibrating&#039; as they collide back and forth between neighbouring atoms, since the structure is an ordered FCC lattice. This of course occurs until the kinetic energy has been dissipated evenly between all atoms in the solid, at which point the VACF has decayed to a constant value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695760</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695760"/>
		<updated>2018-03-27T22:15:38Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, initially has an upwards curvature, indicating some sort of external force acting on the particles. The positive curvature in fact indicates that we are looking at the ballistic regime, which occurs in the gaseous phase since the density is so low, resulting in the atoms having a relatively long mean free path length. The gradient of the MSD for the gaseous calculations were only measured by taking the subsequent linear region into account, from around timestep 2250 onwards. This part of the function is known as the diffusive regime, and corresponds to the true random motion of particles in the system, and can therefore be used to calculate the diffusion coefficient of the system with adequate accuracy. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|6.3333 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|6.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities. When C(τ) = 1, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is greater than that for the liquid simulation. This may be attributed to the fact that atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient / σ/√(ε/m*)&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695757</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695757"/>
		<updated>2018-03-27T22:00:12Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
A minimum in a VACF corresponds to the velocities of the atoms in the system being negatively correlated to their initial reference velocity, whereas a maximum corresponds to the velocities of the atoms in the system being positively correlated (i.e. similar) to their initial velocities. When C(τ) = 1, this basically means that the atoms are travelling at their initial velocities. For this reason, it makes sense that the VACF of the 1D harmonic oscillator oscillates between +1 and -1, reflecting the fact that the particles oscillate between some given maximum velocity, zero velocity, and the same given velocity in the opposite direction. No collisions occur in the 1D harmonic oscillator system that could destroy the correlation of the velocities of the particles with their initial velocities.&lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and solid systems, the VACF quickly decays to a minimum, which can be thought of as occurring due to all particles in the system having collided. The minimum for the solid system is greater than that for the liquid simulation. This may be attributed to the fact that atoms in the solid system form a more ordered FCC lattice, hence the particles will collide in a uniform fashion to give a clear, more definite negative correlation once all the particles in the system have collided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695739</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695739"/>
		<updated>2018-03-27T21:14:30Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas2 RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Gas2_RS7913.png&amp;diff=695738</id>
		<title>File:MSD Gas2 RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Gas2_RS7913.png&amp;diff=695738"/>
		<updated>2018-03-27T21:13:15Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Solid_RS7913.png&amp;diff=695737</id>
		<title>File:MSD Solid RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Solid_RS7913.png&amp;diff=695737"/>
		<updated>2018-03-27T21:12:49Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: Rs7913 uploaded a new version of File:MSD Solid RS7913.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Solid_RS7913.png&amp;diff=695736</id>
		<title>File:MSD Solid RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Solid_RS7913.png&amp;diff=695736"/>
		<updated>2018-03-27T21:12:13Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: Rs7913 uploaded a new version of File:MSD Solid RS7913.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695728</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695728"/>
		<updated>2018-03-27T21:04:10Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDFs for the solid, liquid and gaseous systems have been plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:RDF RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDF_RS7913.png&amp;diff=695726</id>
		<title>File:RDF RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDF_RS7913.png&amp;diff=695726"/>
		<updated>2018-03-27T21:01:38Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695561</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695561"/>
		<updated>2018-03-27T14:51:38Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature because the inherent chemical properties of the system have not changed. Since both the density and volume - because we are considering the heat capacity of some unit volume V (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V) - are fixed, the number of particles being considered does not change as the temperature is varied, hence the internal energy remains constant. Since the heat capacity at constant volume can be defined as C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt; = dU/dT, the fact that the internal energy remains constant as the temperature is varied inherently means that the heat capacity also remains constant as the temperature is varied.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695548</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695548"/>
		<updated>2018-03-27T13:51:41Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected; the heat capacity per unit volume should remain constant with respect to temperature.  &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity of some unit volume (V) of the system (C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V), a higher density of atoms means a greater number of atoms in that unit volume (V) being considered. It makes sense that a greater number of atoms would require more heat energy to raise the average kinetic energy of the particles by some particular amount than that required by that of fewer atoms in that same volume. Since temperature corresponds to the average kinetic energy of particles in a system, it would require more heat energy to raise the temperature of a given volume of some material of higher density by a given amount compared to that required by the same system at lower density - i.e. the more dense system has a higher heat capacity per unit volume.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695545</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695545"/>
		<updated>2018-03-27T13:30:27Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out over the course of the simulation, indicating that this smaller system size may not be quite large enough to gain accurate information in terms of the MSD. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected....&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695535</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695535"/>
		<updated>2018-03-27T12:50:37Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. In the case of the liquid, excellent linear behaviour is maintained throughout the simulation, however, in the solid and gas phases, it does require some time for linear behaviour to be established, and this could be attributed to the time required for the simulation to equilibrate following the initial random assignment of velocities to all of the particles. In the solid phase, oscillations can be seen that fade away, which correspond to anisotropic vibrations in the system spreading over the whole solid as equilibrium is reached, and the system does equilibrate relatively quickly. The MSD function for the gas phase, however, seems to be an upwards curve, indicating some sort of external force acting on the particles. This could be attributed to the system not having reached equilibrium within the timeframe of the simulation - it may require more time to reach equilibrium in the gas simulation due to the decreased density of the system meaning fewer collisions, and hence a longer time required to distribute all the kinetic energy (roughly) evenly between all particles in the system. This may be resolved by using a smaller timestep, or by running the simulation for a longer period of time. I would not expect that increasing the number of particles in the system would result in equilibrium being reached, since both the 8000-atom and 1000000-atom simulations result in similar curves with a positive second derivative (curvature) throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
As expected, the gradient was greatest for the gas, followed by the liquid, whereas the gradient for the solid phase was essentially zero. This is because particles in the gas phase move the most (due to the lower density meaning movement of particles is not constricted by collisions), followed by those in the liquid. The fact that the solid function is essentially flat reflects the fact that the particles do not have net movement in the solid, but only some vibrations of course. &lt;br /&gt;
&lt;br /&gt;
In the case of the liquid and gas simulations, increasing the size of the system from 8000 to 1000000 atoms doesn&#039;t seem to result in any great qualitative difference in terms of the MSD. However, in the case of the solid simulation it can clearly be seen that the MSD flattens out to a virtually straight line in the 1000000-atom simulation, whereas for the 8000-atom simulation, the function does not really completely flatten out at any point in the simulation, indicating that the system size may not have been quite large enough &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695529</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695529"/>
		<updated>2018-03-27T12:18:50Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
Each plot of the MSD vs time (timestep) is essentially a measure of how far particles in the system have moved with respect to time. In all cases we would expect the function to be linear, since any motion of particles corresponds to random Brownian motion, or random vibrations in the case of the solid system, rather than some external force acting on the particles. An upwards curve would indicate that there is some sort of drift of the molecules, due to some net force acting on the particles, and a plateau in the function would indicate that the particle is confined, or constrained, in some sort of way. However, the function does take some time &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695395</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695395"/>
		<updated>2018-03-27T01:50:50Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
It is worth noting that using the LJ cutoff of r = 3.2, neglecting interactions where r &amp;gt; 3.2, may have given rise to some error in the case of the liquid and gas simulations. It can be seen that the RDF of both the liquid and gas simulations have decayed to a constant value of g(r) = 1 when r &amp;gt; 3.2. In the case of the liquid simulation, it would not be surprising if a more accurate simulation with a higher LJ cutoff gave rise to further peak(s) in the RDF when r &amp;gt; 3.2, as well as better defined peaks that are closer to one another for r &amp;lt; 3.2. In the case of the gas simulation, using a higher LJ cutoff would likely result in a broader peak than that seen in the RDF above, that decays to the constant value of g(r) = 1 at a radius greater than 3.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695394</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695394"/>
		<updated>2018-03-27T01:48:48Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless|500px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695393</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695393"/>
		<updated>2018-03-27T01:48:08Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
[[File:FCC Nearest Neighbours RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695392</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695392"/>
		<updated>2018-03-27T01:47:00Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure. The first, second and third peaks in the RDF, at around r = 1.03, 1.49, and 1.83 correspond to the first, second and third nearest neighbours in the FCC lattice. The second nearest neighbour is the length of one side of the cubic unit cell, which was earlier calculated to be equal to 1.49380 (for a FCC lattice with a point number density of 1.2). The value of 1.49 from the RDF agrees well with the calculated value of 1.49380. In the FCC lattice, there are 12 nearest neighbours, 6 second nearest neighbours, and 24 third nearest neighbours, and the fact that the third peak in the RDF is of considerably greater intensity (g(r)) than the second reflects the fact that there are many more (4 times as many) second nearest neighbours in comparison to first nearest neighbours. The first, second and third nearest neighbours in the FCC lattice are illustrated in the diagram below:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695391</id>
		<title>File:FCC Nearest Neighbours RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695391"/>
		<updated>2018-03-27T01:45:58Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: Rs7913 uploaded a new version of File:FCC Nearest Neighbours RS7913.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695390</id>
		<title>File:FCC Nearest Neighbours RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695390"/>
		<updated>2018-03-27T01:44:11Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: Rs7913 uploaded a new version of File:FCC Nearest Neighbours RS7913.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695389</id>
		<title>File:FCC Nearest Neighbours RS7913.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_Nearest_Neighbours_RS7913.png&amp;diff=695389"/>
		<updated>2018-03-27T01:38:47Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695387</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695387"/>
		<updated>2018-03-27T01:11:06Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no further order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there are 3 discernible peaks in the RDF, corresponding to the first, second and third solvation spheres. Since the density of the liquid is considerably higher than that of the gas - 10 times higher than the density of the gas - longer-range interactions become more important, and this gives rise to the short-range order that can be seen in the RDF.&lt;br /&gt;
&lt;br /&gt;
In the solid phase, the atoms (have been commanded, by the software, to) occupy an ordered FCC lattice structure, in which the atoms can only move by very small amounts as the structure vibrates – the atoms are essentially held still. Hence, there are far more peaks in the RDF corresponding to the long-range order in the crystalline structure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|5.5533 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|5.0833 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.6667 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695380</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695380"/>
		<updated>2018-03-27T00:40:10Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no long range order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there is some longer range order, and&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695379</id>
		<title>Rep:Molecular Dynamics RS7913</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Molecular_Dynamics_RS7913&amp;diff=695379"/>
		<updated>2018-03-27T00:39:07Z</updated>

		<summary type="html">&lt;p&gt;Rs7913: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tasks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Analytical&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.2 is just about short enough to ensure that the total energy doesn&#039;t change by more than 1% over the course of the simulation, since it results in the total energy oscillating between 0.5 and 0.495. The total energy of this simple harmonic oscillator was calculated by summing the kinetic energy (calculated using the velocity from the velocity-Verlet solution) and the potential energy (calculated using the classical simple harmonic motion equation to calculate the force, F = -kx). In a simple harmonic oscillator, the total energy of the system remains constant as kinetic and potential energy are interchanged. It is important to monitor the total energy of a physical system such as this because the amount by which the total energy varies corresponds to the accuracy of the simulation. Of course, the more accurate the approximation, the smaller the amount by which the energy will vary, and a smaller timestep will result in a more accurate approximation.&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Timestep&amp;quot; tab in [https://wiki.ch.ic.ac.uk/wiki/images/8/80/HO_RS7913.xls HO_RS7913.xls]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TASK2 RS7913.png|frameless]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK3.png RS7913|frameless|640x640px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
[[File:TASK4 RS7913.png|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If random starting coordinates were given to the atoms, two or more atoms may be generated very close to one another. This would mean that these atoms would experience a very strong repulsive force between one another, as given by the Lennard-Jones potential, since the &#039;1/r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;&#039; term dominates at shorter distance. Hence, the system may not reach equilibrium by the time the simulation has run - although increasing the length of time a simulation is run would increase the chance of the system reaching equilibrium, this would be of computational cost.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
p = m/v&lt;br /&gt;
&lt;br /&gt;
Volume of a lattice point = (1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, number density of lattice points = 1/(1.07722)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.8&lt;br /&gt;
&lt;br /&gt;
Face-centered cubic (FCC) lattice contains 4 lattice points within the unit cell&lt;br /&gt;
&lt;br /&gt;
Therefore, the volume of one lattice point = 4/1.2&lt;br /&gt;
&lt;br /&gt;
Side length of FCC unit cell = (4/1.2)&amp;lt;sup&amp;gt;1/3 &amp;lt;/sup&amp;gt;= 1.49380&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The create_atoms command created 1000 atoms for the simple cubic lattice, for which each unit cell contains 1 atom. Since the FCC unit cell contains 4 atoms, the create_atoms command would have created 1000 x 4 = 4000 atoms if this lattice had been defined instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mass 1 1.0&amp;quot; sets the mass of atom type 1 to 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_style lj/cut 3.0&amp;quot; sets the formula used to calculate pairwise interactions between atoms as that defined by the Lennard-Jones potential, with a cutoff of r* = 3.0 &lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff * * 1.0 1.0&amp;quot; sets the forcefield coefficients - in this case the Lennard-Jones parameters σ and ε - to 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using the velocity-Verlet algorithm, since the starting positions of the atoms&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their velocities at the same time&#039;&#039;&#039; &#039;&#039;&#039;(&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) must be defined when using the velocity-Varlet. When using the Verlet algorithm, the starting positions of the atoms (&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt;&#039;&#039;&#039;) and their positions one timestep in the past (&amp;lt;math&amp;gt;\mathbf{x}_i\left(-\delta t\right)&amp;lt;/math&amp;gt;) must be defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows for the timestep to be easily modified by modifying the value &amp;quot;${timestep}&amp;quot;, and other sections of the script can also be linked to &amp;quot;${timestep}&amp;quot; to ensure that the timestep for all these sections of the script is set to the desired &amp;quot;${timestep}&amp;quot; value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the total energy, temperature, and pressure, against time for the 0.001 timestep experiment are shown below. It can be seen that the simulation reaches equilibrium at around 0.5 s, after which the total energy oscillates about the average equilibrium value.&lt;br /&gt;
[[File:EnergyVsTime RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TempVsTime RS7913.png|frameless|538x538px]]&lt;br /&gt;
[[File:PressureVsTime_RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:TotEnergyVsTAllTimesteps RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy against time for all timesteps has also been plotted above (bottom right graph). It is clear that the average total energy for the experiments carried out using time steps of 0.001 s and 0.0025 s were very similar; the total energy for both of these experiments oscillated about virtually the same average equilibrium value. The 0.0075 s and 0.01 s timestep experiments both reached equilibrium, however the average energy at equilibrium was considerably greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, and this is indicative that using these experiments are not as accurate. In addition, the amount by which the total energy oscillated once equilibrium was reached was greater for the 0.0075 s experiment and even greater for the 0.01 s experiment, further testifying that these simulations were not as accurate. In the case of the 0.015 s timestep, the simulation did not even reach equilibrium over the duration of the simulation; the energy just continued increasing further and further. This 0.015 s timestep simulation is clearly not accurate, and using such a large timestep is a particularly bad choice. Whilst using the 0.001 s timestep would give the most accurate results, the 0.0025 s timestep is  sufficiently short to give acceptable results since the average total energies from both of these calculations are virtually the same. Using a timestep greater than 0.0025 s would likely give inaccurate results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 chosen&lt;br /&gt;
&lt;br /&gt;
T = 2, 3.5, 5, 6.5, 8&lt;br /&gt;
&lt;br /&gt;
p = 2.5, 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 5 RS7913.png|frameless|263x263px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number 100 sets the Nevery variable, which is the number of timesteps between which each sample of the (thermodynamic) data is taken.&lt;br /&gt;
&lt;br /&gt;
The number 1000 sets the Nrepeat variable, which is the number of timesteps between which averages of this sampled data (set by Nevery) are taken.&lt;br /&gt;
&lt;br /&gt;
The number 100000 sets the Nfreq variable, which is the number of timesteps over which an average of the previous averages (determined by Nrepeat) are taken.&lt;br /&gt;
&lt;br /&gt;
The following line &amp;quot;run 100000&amp;quot; instructs LAMMPS to run the simulation over 100000 timesteps. Hence, setting the Nfreq variable to 100000 as done for this simulation essentially instructs LAMMPS to take an average over the whole course of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 6 RS7913.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density, at both reduced pressures of 2.5 and 3.0, was lower than that predicted by the ideal gas law. This is because the ideal gas law models the atoms as simply hard spheres, meaning the atoms cannot get as close to one another as in the molecular dynamics simulations carried out, in which the Lennard-Jones potential is used to model intermolecular interactions. This function is a more accurate representation of the true intermolecular interactions, and accounts for the more gradual onset of repulsion between two atoms as they are brought closer together, caused by electrostatic repulsion between the outer electrons - the deformability of atoms is not accounted for by the ideal gas law. This discrepancy increases with increasing pressure since, at higher pressure, the particles spend more time closer to one another, and bump into one another more often, therefore the deformability of atoms accounted for in the molecular dynamics simulation becomes more significant relative to the ideal gas law hard sphere model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:TASK 7 RS7913.png|frameless|740x740px]] &lt;br /&gt;
&lt;br /&gt;
For both densities of 0.2 and 0.8, the heat capacity at constant volume, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, decreases with increasing temperature. This trend would not be expected because higher energy vibrational, rotational and translational energy levels are closer together (in terms of energy), hence the overall energy states the atoms can occupy become more closely spaced at higher energies. This means that excitation into higher energy states would require less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;, and a given material should be able to absorb more energy. Therefore, it should require more heat energy to raise the temperature of a material by a given amount at higher temperature compared to that required at some lower temperature. &lt;br /&gt;
&lt;br /&gt;
(This trend would be expected because higher vibrational, rotational and translational energy levels are closer together, hence the overall energy states the atoms can occupy become more closely spaced at higher energies. Also, there is a greater degeneracy of energy states at higher energies. Therefore, excitation into higher energy states requires less energy as the temperature is increased, i.e. promotion into higher energy states is &#039;easier&#039;.)&lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing pressure, which would be the expected trend. Since we are considering the heat capacity at constant volume, a higher pressure means a greater density of atoms, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The heat capacity, [[C]]&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;, also increases with increasing density, which would be the expected trend. Since we are considering the heat capacity at constant volume, higher density of atoms means a greater number of atoms in the volume considered, i.e. a greater number of atoms per unit volume, and it makes sense that a greater number of atoms would be able to absorb more heat (resulting in a smaller increase in temperature) than fewer atoms in that same volume. Therefore, it would require more heat energy to raise the temperature of a given volume of some material by a given amount at higher pressure compared to that required at some lower pressure.  &lt;br /&gt;
&lt;br /&gt;
The input script for the calculation carried out at a density of 0.2 and temperature of 2.0 can be found [https://wiki.ch.ic.ac.uk/wiki/images/7/7b/NvT_D_0.2_T_2.0_RS7913.in here].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the system in the gas phase has one broad peak around r = 1 - the average density value - which then tapers off to a constant value of g(r) = 1. This means that these molecules in the gas phase essentially have only one coordination sphere, and no long range order. This is because the density of the gas is so much lower that longer range interactions (r &amp;gt; 2) are essentially non-existent, and the distribution of gas molecules at a distance r &amp;gt; 2.5 is essentially random.&lt;br /&gt;
&lt;br /&gt;
In the liquid phase, there is some longer range order, and&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for a vapour (density = 0.05)&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;J. P. Hansen, L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151.&amp;lt;/ref&amp;gt;, liquid (density = 0.8)&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt; and solid (density = 1.2&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;, with lattice type set to fcc), at a reduced temperature of 1.0. The system contains 8000 atoms (20x20x20 grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total MSD as a function of timestep for the solid, liquid and gas simulations carried out with N = 8000 and N = 1000000 have been plotted below, and a linear fit has been applied to each of these functions:&lt;br /&gt;
[[File:MSD Gas RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Liquid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
[[File:MSD Solid RS7913.png|centre|frameless|700x700px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D, was estimated by dividing the gradient of the linear fit by 6:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function, C(τ), for a 1D harmonic oscillator was evaluated as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF SHM Working RS7913.png|frameless|815x815px]]&lt;br /&gt;
&lt;br /&gt;
C(τ) was plotted as a function of time (timestep (τ), between 0 and 500) for the 1D harmonic oscillator, as well as for the Lennard-Jones solid and liquid simulations carried out with N = 8000:&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Vs Timestep Harmonic RS7913.png|frameless|740x740px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF, using a function that created trapezia of 1 timestep &#039;width&#039;.&lt;br /&gt;
[[File:VACF Running Integral N=8000 RS7913.png|left|frameless|538x538px]]&lt;br /&gt;
[[File:VACF Running Integral N=1000000 RS7913.png|frameless|538x538px]]&lt;br /&gt;
&lt;br /&gt;
D was calculated using the by dividing the integral of C(τ) over all τ (0 to 5000) by 3.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
!Phase&lt;br /&gt;
!N = 8000&lt;br /&gt;
!N = 1000000&lt;br /&gt;
!Literature Value&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.060364158&lt;br /&gt;
|0.022764742&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|34.47327454&lt;br /&gt;
|45.04573814&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1089.389257&lt;br /&gt;
|1634.232899&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rs7913</name></author>
	</entry>
</feed>