<?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=Jw7815</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=Jw7815"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Jw7815"/>
	<updated>2026-04-05T16:38:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=667092</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=667092"/>
		<updated>2018-02-20T23:51:01Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=color:red&amp;gt;  Overall Feedback. A generally good understanding of the MD simulations carried out was conveyed. The abstract, introduction and methodology sections were good. The results and discussion section would have benefited from being more concise: however this is difficult as some tasks were not appended at the end, but instead discussed in the report, increasing the length required to cover all the material. Marks were dropped due to a couple missing tasks/results.&amp;lt;/span&amp;gt;&amp;lt;span style=color:blue&amp;gt; &#039;&#039;bbbutttt the lattice spacing for solids is in there! (and I didnt want to clutter some some workings with calculations that were leaning toward the basic side)  :(  P.S I tried to structure some task in the results and discussion so that it could flow more appropriately like in a research paper, as was told to us.&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  Nice and concise. You could have included 1-2 sentences of motivation. It is not important, but molecular dynamics is usually abbreviated to MD; MDS for &amp;quot;molecular dynamics simulation&amp;quot; is rarely seen. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  I really like this introduction. Good points made using simple, easy to understand language. A bit more specificity would have been a bonus.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency &amp;lt;span style=color:red&amp;gt;  Nice detail, although we really could have afforded it, it&#039;s very cheap. &amp;lt;/span&amp;gt;. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel &amp;lt;span style=color:red&amp;gt;  You do not and should not have to credit excel. &amp;lt;/span&amp;gt;. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions&amp;lt;span style=color:red&amp;gt; I understand what you are trying to say, but the wording makes it not completely correct. &amp;lt;/span&amp;gt;). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour. &amp;lt;span style=color:red&amp;gt; Analogues - yes, as in has the same effect (greater KE to overcome kinetic berries in the PES), but not the same. You could explain these points more clearly. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; There&#039;s a bit of a misunderstanding here - between the inherent chemical properties of a system and what changing these properties would mean for the heat capacity and simulating the heat capacity over our simulation of Lennard-Jones particles. In our simulation, and what I&#039;ve tried to get people previously to suggest, we see a slight decrease in heat capacity with increasing temperature. What do we expect? Constant number of particles.. Internal enegy remains constant.. Cv = dU/dT and thus constant heat capacity. If I changed the material or the particles and changed the DOS or inherent properties of the systme, the heat capacity would vary as you suggest.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated.&amp;lt;span style=color:red&amp;gt; You should have been able to calculate the million atom MSD&amp;lt;/span&amp;gt;. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our understanding of lattice spacings, coordination spheres, and coordination numbers. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable temperature equal 2.0&lt;br /&gt;
variable timestep equal 0.002&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
velocity all create ${temperature} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${temperature} ${temperature} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step atoms etotal temp vol density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_temp2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable varetotal equal (f_aves[4]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable heatcap equal ${N2}*(${varetotal}/f_aves[3])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Ave Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  Tick.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05. &amp;lt;span style=color:red&amp;gt; Correct, we are after the largest timestep that meets the stability criteria: this was 0.2. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system. &amp;lt;span style=color:red&amp;gt; This is not always the case. It&#039;s true that we monitor the energy as an indication of the system&#039;s &amp;quot;health&amp;quot; for this simulation: but why? Think about what ensemble you&#039;re in (microcanonical) and what quantities are conserved. Would you do the exact same thing for another ensemble, e.g. NTV? &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates. &amp;lt;span style=color:red&amp;gt; You should show your working out. You also forgot to calculate the force at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt; &amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick. Good that mentioned what LAMMPS does. You could also remove the stability criteria, and use a very small tilmestep, but this is more expensive and more effort than it&#039;s worth... it is never done, but you should be aware why we can do this.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs &amp;lt;span style=color:red&amp;gt; the two ones correspond to the well depth and sigma  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Correct choice of timestep for right reason. It would be good to add some intuition as to why larger timesteps cause the energy to diverge. Very large time steps will result in an unstable system. This line of reasoning would lead you to the rule of thumb that the tilmestep should be ~1/10 of the highest frequency mode.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Other tasks have been included in the write up. It would have been easier to mark if you appended them here as well... Some numerical answers are not included in the report, and indeed including them would jar the reader. It would have been &amp;quot;safer&amp;quot; to explicitly include them here. Missing: lattice spacing of solid from RDF, &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=667091</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=667091"/>
		<updated>2018-02-20T23:50:32Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=color:red&amp;gt;  Overall Feedback. A generally good understanding of the MD simulations carried out was conveyed. The abstract, introduction and methodology sections were good. The results and discussion section would have benefited from being more concise: however this is difficult as some tasks were not appended at the end, but instead discussed in the report, increasing the length required to cover all the material. Marks were dropped due to a couple missing tasks/results. &#039;&#039;bbbutttt the lattice spacing for solids is in there! (and I didnt want to clutter some some workings with calculations that were leaning toward the basic side)  :(  P.S I tried to structure some task in the results and discussion so that it could flow more appropriately like in a research paper, as was told to us.&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  Nice and concise. You could have included 1-2 sentences of motivation. It is not important, but molecular dynamics is usually abbreviated to MD; MDS for &amp;quot;molecular dynamics simulation&amp;quot; is rarely seen. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  I really like this introduction. Good points made using simple, easy to understand language. A bit more specificity would have been a bonus.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency &amp;lt;span style=color:red&amp;gt;  Nice detail, although we really could have afforded it, it&#039;s very cheap. &amp;lt;/span&amp;gt;. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel &amp;lt;span style=color:red&amp;gt;  You do not and should not have to credit excel. &amp;lt;/span&amp;gt;. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions&amp;lt;span style=color:red&amp;gt; I understand what you are trying to say, but the wording makes it not completely correct. &amp;lt;/span&amp;gt;). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour. &amp;lt;span style=color:red&amp;gt; Analogues - yes, as in has the same effect (greater KE to overcome kinetic berries in the PES), but not the same. You could explain these points more clearly. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; There&#039;s a bit of a misunderstanding here - between the inherent chemical properties of a system and what changing these properties would mean for the heat capacity and simulating the heat capacity over our simulation of Lennard-Jones particles. In our simulation, and what I&#039;ve tried to get people previously to suggest, we see a slight decrease in heat capacity with increasing temperature. What do we expect? Constant number of particles.. Internal enegy remains constant.. Cv = dU/dT and thus constant heat capacity. If I changed the material or the particles and changed the DOS or inherent properties of the systme, the heat capacity would vary as you suggest.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated.&amp;lt;span style=color:red&amp;gt; You should have been able to calculate the million atom MSD&amp;lt;/span&amp;gt;. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our understanding of lattice spacings, coordination spheres, and coordination numbers. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable temperature equal 2.0&lt;br /&gt;
variable timestep equal 0.002&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
velocity all create ${temperature} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${temperature} ${temperature} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step atoms etotal temp vol density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_temp2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable varetotal equal (f_aves[4]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable heatcap equal ${N2}*(${varetotal}/f_aves[3])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Ave Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt;  Tick.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05. &amp;lt;span style=color:red&amp;gt; Correct, we are after the largest timestep that meets the stability criteria: this was 0.2. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system. &amp;lt;span style=color:red&amp;gt; This is not always the case. It&#039;s true that we monitor the energy as an indication of the system&#039;s &amp;quot;health&amp;quot; for this simulation: but why? Think about what ensemble you&#039;re in (microcanonical) and what quantities are conserved. Would you do the exact same thing for another ensemble, e.g. NTV? &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates. &amp;lt;span style=color:red&amp;gt; You should show your working out. You also forgot to calculate the force at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt; &amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick. Good that mentioned what LAMMPS does. You could also remove the stability criteria, and use a very small tilmestep, but this is more expensive and more effort than it&#039;s worth... it is never done, but you should be aware why we can do this.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs &amp;lt;span style=color:red&amp;gt; the two ones correspond to the well depth and sigma  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Correct choice of timestep for right reason. It would be good to add some intuition as to why larger timesteps cause the energy to diverge. Very large time steps will result in an unstable system. This line of reasoning would lead you to the rule of thumb that the tilmestep should be ~1/10 of the highest frequency mode.  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Tick. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=color:red&amp;gt; Other tasks have been included in the write up. It would have been easier to mark if you appended them here as well... Some numerical answers are not included in the report, and indeed including them would jar the reader. It would have been &amp;quot;safer&amp;quot; to explicitly include them here. Missing: lattice spacing of solid from RDF, &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659532</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659532"/>
		<updated>2018-01-31T11:05:18Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our understanding of lattice spacings, coordination spheres, and coordination numbers. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable temperature equal 2.0&lt;br /&gt;
variable timestep equal 0.002&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
velocity all create ${temperature} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${temperature} ${temperature} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step atoms etotal temp vol density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_temp2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable varetotal equal (f_aves[4]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable heatcap equal ${N2}*(${varetotal}/f_aves[3])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Ave Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659248</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659248"/>
		<updated>2018-01-31T02:03:39Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable temperature equal 2.0&lt;br /&gt;
variable timestep equal 0.002&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
velocity all create ${temperature} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${temperature} ${temperature} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step atoms etotal temp vol density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_temp2 v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable varetotal equal (f_aves[4]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable heatcap equal ${N2}*(${varetotal}/f_aves[3])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Ave Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659246</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=659246"/>
		<updated>2018-01-31T02:02:55Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /*  Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Input script for NVT simulations (shown is simulation at T=2.0 ρ=0.2) ===&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658779</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658779"/>
		<updated>2018-01-30T17:02:42Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision, therefore the ballistic regime is more pronounced.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658776</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658776"/>
		<updated>2018-01-30T16:56:10Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 2, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658775</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658775"/>
		<updated>2018-01-30T16:55:15Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01) &amp;lt;ref&amp;gt;J. P. Hansen and L. Verlet, &#039;&#039;Phys. Rev.&#039;&#039;, 1969, &#039;&#039;&#039;184&#039;&#039;&#039;, 151–161.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658774</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658774"/>
		<updated>2018-01-30T16:52:39Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Heat Capacity as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of temperature at different densities]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658773</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658773"/>
		<updated>2018-01-30T16:52:11Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Density as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Densitytemp.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Jw7815Densitytemp.png&amp;diff=658772</id>
		<title>File:Jw7815Densitytemp.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Jw7815Densitytemp.png&amp;diff=658772"/>
		<updated>2018-01-30T16:51:49Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658771</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658771"/>
		<updated>2018-01-30T16:47:42Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Density as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Density as a function of temperature at different pressures ]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658766</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658766"/>
		<updated>2018-01-30T16:40:53Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 12, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658753</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658753"/>
		<updated>2018-01-30T16:30:28Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Gas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily (Figure 8).&lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658751</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658751"/>
		<updated>2018-01-30T16:29:39Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 2: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658750</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658750"/>
		<updated>2018-01-30T16:27:17Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation 2, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658747</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658747"/>
		<updated>2018-01-30T16:21:43Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Aims and Objectives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658744</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658744"/>
		<updated>2018-01-30T16:18:51Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the diffusive and dynamic properties of different phases under varying thermodynamic conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in these calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658736</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658736"/>
		<updated>2018-01-30T16:11:32Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Density as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658734</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658734"/>
		<updated>2018-01-30T16:02:28Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Creating a Simulation Box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation to avoid the overlaps.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658732</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658732"/>
		<updated>2018-01-30T15:56:56Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
MDS is a powerful tool that can be used to obtain important information about a system without having to run laboratory experiments. We have demonstrated how simple simulations of Ar atoms with interactions modelled by an LJ potential can allow us to study how the density or heat capacity of fluids change as function of temperature. The RDF has also been used to study the underlying structure of fluids, with results obtained in agreement with our traditional understanding of the different phases. Lastly, we have shown how MDS can be used to obtain the diffusion coefficients using the MSD and VACF, each method carrying their own advantages and disadvantages. The numerical result from these also highlight that simulations may not always provide perfectly accurate values, and thus have to be reinforced by experimental results.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658678</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658678"/>
		<updated>2018-01-30T15:08:18Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Heat Capacity as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Heat capacity at constant volume as a function of time]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell.]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658620</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658620"/>
		<updated>2018-01-30T14:10:26Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
For the normal simulation, the trend is expected, although the diffusion coefficient for solid is much higher than what we would expect. For the million atom simulation however, the trend is anomalous, with the diffusion coefficient obtained for solid being higher than that for liquid. Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658614</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658614"/>
		<updated>2018-01-30T13:57:25Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.37&lt;br /&gt;
|71.12&lt;br /&gt;
|0.062&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.96&lt;br /&gt;
|77.99&lt;br /&gt;
|0.067&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.51&lt;br /&gt;
|4223.50&lt;br /&gt;
|3.65&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658611</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658611"/>
		<updated>2018-01-30T13:54:56Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Solidmsd.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Jw7815Solidmsd.png&amp;diff=658609</id>
		<title>File:Jw7815Solidmsd.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Jw7815Solidmsd.png&amp;diff=658609"/>
		<updated>2018-01-30T13:54:37Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658608</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658608"/>
		<updated>2018-01-30T13:53:26Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.00 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|1.07 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|3.84 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658605</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658605"/>
		<updated>2018-01-30T13:51:48Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|1.45 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.41 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|2.79 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658601</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658601"/>
		<updated>2018-01-30T13:44:28Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Solids and Liquids */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Gradient&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Normal simulation&lt;br /&gt;
!Million atom simulation&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658599</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658599"/>
		<updated>2018-01-30T13:41:54Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!hi&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658589</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658589"/>
		<updated>2018-01-30T13:32:31Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!he&lt;br /&gt;
!hello&lt;br /&gt;
!heeelo&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|176.919&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|155.586&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658584</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658584"/>
		<updated>2018-01-30T13:22:18Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Heat Capacity as a function of temperature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, the heat capacity corresponds to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt;, which would be represented by a horizontal line with a constant value in the graph.&lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658579</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658579"/>
		<updated>2018-01-30T13:16:11Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
To illustrate the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nevery&#039;&#039;=100 : Value is &#039;&#039;&#039;computed every 100 timesteps&#039;&#039;&#039; (i.e. &amp;lt;math&amp;gt;V_{100} + V_{200} + V_{300} + ....) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nrepeat&#039;&#039;=1000 : Average will be &#039;&#039;&#039;over 1000 quantities&#039;&#039;&#039; (i.e. 1000 &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt; values)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Nfreq&#039;&#039;=100000 : Final averaged quantity is generated on timesteps that are a multiple of 100000&lt;br /&gt;
&lt;br /&gt;
The Initial averages, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_1 = \frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; AV_2 = \frac {V_{100100} + V_{100200} + V_{100300} + V_{100400}  ... + V_{200000}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Final averaged quantity,&lt;br /&gt;
&amp;lt;math&amp;gt; AV = \frac {AV_1 + AV_2 + AV_3  ... + AV_n}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the &#039;run 100000&#039; at the end of the code, we are only dealing with 100000 timesteps, meaning that only &amp;lt;math&amp;gt;AV_1&amp;lt;/math&amp;gt; is taken since it already covers 100000 timesteps by itself. Assuming a timestep of 0.002fs, the simulation will take 0.002fs x 100000 = &#039;&#039;&#039;200fs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658567</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658567"/>
		<updated>2018-01-30T12:59:23Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
In the code above, let value at each timestep &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; denoted as &amp;lt;math&amp;gt;V_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The average is calculated via &amp;lt;math&amp;gt;\frac {V_{100} + V_{200} + V_{300} + V_{400}  ... + V_{100000}}{1000}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658564</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658564"/>
		<updated>2018-01-30T12:57:46Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
In the code above, let value at each timestep be denoted as Vx&lt;br /&gt;
&lt;br /&gt;
The average is calculated via V100 + V200 + V300 + V400  ... + V100000 &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658548</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658548"/>
		<updated>2018-01-30T12:29:23Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Thermostats and Barostats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658546</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658546"/>
		<updated>2018-01-30T12:28:29Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658545</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658545"/>
		<updated>2018-01-30T12:27:58Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Thermostats and Barostats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T \ \ (8)&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} \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, can be taken out of the sum in &amp;lt;math&amp;gt;(9)&amp;lt;/math&amp;gt; to give: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} \ \ (10)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling out terms and rearranging gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658538</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658538"/>
		<updated>2018-01-30T12:16:55Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Lattice Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2a: Lattice Types: simple cubic =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
===== Task 2b: Lattice Types: face-centered cubic =====&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658535</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658535"/>
		<updated>2018-01-30T12:13:53Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 2: Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658534</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658534"/>
		<updated>2018-01-30T12:12:54Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 7, and shown in Figure 11.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (7)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658533</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658533"/>
		<updated>2018-01-30T12:12:29Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* VACF derivation for a 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (5) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658530</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658530"/>
		<updated>2018-01-30T12:11:27Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 2: Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658529</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658529"/>
		<updated>2018-01-30T12:11:09Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Method 1: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658527</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658527"/>
		<updated>2018-01-30T12:10:19Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658525</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658525"/>
		<updated>2018-01-30T12:09:39Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.1]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.2]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155x\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658523</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658523"/>
		<updated>2018-01-30T12:08:58Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Task 1: Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: (Top) Comparison between analytical displacement modelled by a harmonic oscillator and the Verlet estimated displacement (Middle) Total energy against time using the Verlet algorithm (Bottom) Error in Verlet algorithm compared to analytic model. Note: All graphs use timestep = 0.01&amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Error in Verlet algorithm compared to analytic model when the timestep used is increased. Shown here is timestep = 0.02 &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155x\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658520</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658520"/>
		<updated>2018-01-30T12:00:45Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* 1D Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 9 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155x\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658394</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658394"/>
		<updated>2018-01-30T01:31:04Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications ranging from molecular biology, where it has been used to effectively to enhance our understanding of protein folding ion transport across membranes,&amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt; and even in environmental studies to study the dehumidification process in air.&amp;lt;ref&amp;gt;T. Xie, C. Liu and X. Zhang, &#039;&#039;Procedia Eng.&#039;&#039;, 2017, &#039;&#039;&#039;205&#039;&#039;&#039;, 116–122.&amp;lt;/ref&amp;gt; More directly, the results obtained from this present study (e.g. in diffusion) is a starting point for more complex studies, such as in the diffusion of nanoparticles (NPs) through mucus layer in drug delivery systems.&amp;lt;ref&amp;gt;J. Wang and X. Shi, &#039;&#039;Acta Mech. Solida Sin.&#039;&#039;, 2017, &#039;&#039;&#039;30&#039;&#039;&#039;, 241–247.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 8 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155x\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658393</id>
		<title>Rep:LSim:jw815</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:LSim:jw815&amp;diff=658393"/>
		<updated>2018-01-30T01:15:17Z</updated>

		<summary type="html">&lt;p&gt;Jw7815: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
In this report, Molecular Dynamics Simulation (MDS) was used to study the thermodynamic properties and to calculate diffusive and dynamic properties of different phases under varying conditions. The results obtained were largely consistent with our macroscopic understanding of these properties - the Radial Distribution Function (RDF) for the different phases is consistent with our understanding of microscopic structure of the phases, the diffusion coefficients calculated using the mean square displacement and velocity correlation function techniques showed characteristic behavior with ballistic and diffusive regimes. However, the limitations of simulations are also highlighted in the density and heat capacity calculations, where deviation from expected behavior is observed.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
MDS act as a bridge between microscopic length and time scales and the macroscopic world. By providing a guess of the interactions between particles, we obtain a prediction of the bulk thermodynamic properties. MDS also allows us to obtain hidden details behind bulk measurements, for example, the velocity autocorrelation function is linked to the diffusion coefficient, but the former is much easier to calculate computationally while the diffusion coefficient is much easier to obtain experimentally. MDS also has numerous real-world applications. In molecular biology, it has been used to effectively to enhance our understanding of molecular recognition, protein folding, and the transport of ions and small molecules across membranes, &amp;lt;ref&amp;gt;A. Hospital, J. R. Goñi, M. Orozco and J. L. Gelpí, &#039;&#039;Adv. Appl. Bioinform. Chem.&#039;&#039;, 2015, &#039;&#039;&#039;8&#039;&#039;&#039;, 37–47.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your introduction paints a picture of the background of the research; &lt;br /&gt;
what has been done by others and where is the niche for your work. How &lt;br /&gt;
will your work benefit the community - maybe it&#039;s a new technique. You &lt;br /&gt;
open up the niche so the subsequent discussion inserts your work into &lt;br /&gt;
the existing community or (for high impact journals like Nature) creates&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;a question and novel direction that can be picked up and worked on by &lt;br /&gt;
other interested parties. In this lab, it would be good if you can &lt;br /&gt;
demonstrate some of the importance of your results and impact it had on &lt;br /&gt;
Science and society.&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
* Demonstrate how a Lennard-Jones fluid can be simulated to provide information on bulk properties of systems that are weakly interacting via the induced dipole interactions (e.g. Ar). Such information include the density, heat capacity, structural properties, and diffusive properties.&lt;br /&gt;
* Highlight that bulk properties (e.g. diffusion coefficient) can be calculated using different methods &lt;br /&gt;
* To rationalise any differences observed between these simulations compared to (1) Ideal gas behaviour (2) Experimentally obtained results.&lt;br /&gt;
&lt;br /&gt;
== Simulation Method ==&lt;br /&gt;
All simulations were performed using the Large-scale Atomic/Molecular Massively Parallel Simulator Package (LAMMPS). Fluids were modelled using a Lennard-Jones potential with a cut-off radius of σ=3. Long tail correction was not applied in order to improve computational efficiency. All Liquid and vapour phase simulations were melted from a simple cubic crystal (sc) with an input density of 0.8 and 0.01 respectively, whereas the solid phase was simulated with a face-centered cubic (fcc) lattice with an input density of 1.2. The use of a lattice avoids random generation of atoms which result in large energies being computed. Unless otherwise stated, the simulation was performed at T=1.2 and controlled using a thermostat and barostat. All thermodynamic quantities were recorded every 0.002fs time steps, and the data was processed using Microsoft excel. Unless otherwise stated, all data presented are in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
&lt;br /&gt;
=== Density as a function of temperature ===&lt;br /&gt;
[[File:Jw7815Npt.png|480px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
At both pressures, the simulated density is lower than the density as predicted by the ideal gas model. This is because the ideal gas model assumes that particles behave do not interact (in this context, they do not repel each other) and therefore more particles can fit into a confined space. However, in the simulated model, the atoms are governed by Lennard-Jones interactions. When the interatomic separation is small, the repulsion term dominates, and the atoms are pushed further apart from each other, resulting in a lower density. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the deviation from ideal behaviour is less in both cases. This is because at high temperatures, particles oscillate about the equilibrium to a greater extent and this fast oscillation makes the interaction between particles transient (as they have no time to react to these interactions). This is analogous to experiencing weaker interactions/repulsions and hence tending towards ideal behaviour.&lt;br /&gt;
&lt;br /&gt;
Comparing the simulations at higher and lower pressure, the one at higher pressure shows a greater deviation from ideality at all temperatures. This is a result of the greater interatomic interactions/repulsions by atoms which are found closer together at high density.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Heat Capacity as a function of temperature ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Cv-v against temp.png|480px|thumb|left|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: BLABLALBLALLLBA]]&lt;br /&gt;
At both densities, heat capacity at constant volume decreases as temperature increases. At higher temperatures, higher energy states can be occupied resulting in an increase in the density of high energy states. Thus, less energy is required to bring about the same increase in temperature of a system compared to a system at lower temperature, where the states populated are low in energy. This trend is expected for real gases which experience interatomic interactions modelled by a Lennard-Jones potential. For a monoatomic ideal gas, with no interactions, a constant heat capacity corresponding to &amp;lt;math&amp;gt;C_V = \frac{3}{2}R&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At higher density, the heat capacity is also higher. This is also expected because a system of higher density has more energy levels per unit volume, and more energy is required to effect the same increase in temperature. This is distinct from the temperature argument which is concerned with the &#039;&#039;relative population&#039;&#039; of states, rather than the the &#039;&#039;number of states per unit volume&#039;&#039; in the first place.&lt;br /&gt;
&lt;br /&gt;
Furthermore deviations from expected constant behaviour can also be explained through simulation limitations. Specifically, a small LJ cut-off radii of σ=3 was chosen to improve computational efficiency. However, this results in a loss of long range interactions. Given that the values of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; is small (10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; in magnitude), this potentially results in susceptibility to errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Function ===&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815RDFRDF.png|480px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Radial Distribution Function (RDF) as a function of r for a simulated LJ solid, liquid, and gas. T=1.2 were used for the simulations and Solid(fcc, ρ =1.4), Liquid(sc, ρ =0.8), Gas(sc, ρ =0.01)]]&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is the probability of finding a particle at distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another tagged particle. This function correlates the bulk density of the matter, &amp;lt;math&amp;gt;\rho^{bulk}&amp;lt;/math&amp;gt; (which will always be constant) and the local density or number density, &amp;lt;math&amp;gt;\rho(r)&amp;lt;/math&amp;gt; (which is dependent on the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from a reference point) according to equation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho(r)=\rho^{bulk}g(r) \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Solids====&lt;br /&gt;
[[File:Jw7815resultsFcc.png|150px|thumb|right|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Positions of atoms in a fcc lattice, with the respective distance for each coordination shell shown]]&lt;br /&gt;
&lt;br /&gt;
Solids have regular periodic structures as a result of short and long range interactions, with atoms vibrating about their specific lattice positions. The peaks observed (Figure 3) corresponds to where the atoms are highly likely to be found (in their lattice positions), for this simulation in a fcc lattice, the first, second, and third peak at σ, √2σ, √3σ corresponds to the first second third coordination shells respectively. These shells are illustrated in Figure 4, with atoms at position [0.5 0.5 0.5] contributing to the first shell, atoms at position [1 0 0] contributing to the second shell, and atoms at position [1 0.5 0.5] contributing to the third shell. The probability of locating an atom between peaks is very low, as the atoms are already packed very closely together to fill the space most efficiently. &lt;br /&gt;
&lt;br /&gt;
====Liquids====&lt;br /&gt;
Atoms in liquid move dynamically and do not maintain a fixed structure. Their short range order is represented by the presence of peaks at small r, with the first peak at σ corresponding to the first coordination sphere, and the next one at an approximate distance of ~σ (approximate because there is no exact ordering in the liquid). The peaks eventually decrease in amplitude as long range order is lost, and at large r, the atoms are practically independent of each other and the distribution returns to g(r)=1. It is important to note that because a cut-off of 3σ was used in the simulation, no peaks are seen after this limit. In reality, it can be expected that small peaks will still be seen in the region where the separation does not preclude any interactions from occurring.&lt;br /&gt;
&lt;br /&gt;
====Gases====&lt;br /&gt;
Gaseous atoms do not have an ordered structure, and will only show one broad peak initially, after which it plateaus at g(r)=1. This is because the atoms are moving around randomly in a sporadic motion (Brownian motion), and at most only have a single short-lived coordination sphere representing the interactions between particles at close range modelled by the Lennard-Jones potential used for this simulation. Once again, because a cut-off of 3σ was used, any potential interactions at this range were ignored.&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==== Method 1: Mean Squared Displacement ====&lt;br /&gt;
[[File:Jw7815Diffsolid.png|320px|thumb|left|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: MSD against timestep for a solid system. ]]&lt;br /&gt;
[[File:Jw7815Diffliq.png|320px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: MSD against timestep for a liquid system.]]&lt;br /&gt;
[[File:Jw7815Diffgas.png|320px|thumb|left|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: MSD against timestep for a gaseous system.]]&lt;br /&gt;
The Mean Square Displacement (MSD), &amp;lt;math&amp;gt;\langle r^2\left(t\right)\rangle&amp;lt;/math&amp;gt;, is a measure of the deviation of a particle with respect to a reference position over time. Mathematically, it is related to the diffusion coefficient through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the equation, it follows that the more a particle travels, the greater it&#039;s MSD, and hence the higher the diffusion coefficient. For solids, the atoms vibrate in fixed lattice positions, giving a constant MSD. Liquids and gases are not confined to fixed lattice positions, therefore MSD increases with time. In both cases, a parabolic behaviour is observed. This is because the the path an atoms takes will be an approximate straight line with constant velocity (proportional to time squared) until it collides with its neighbour - this corresponds to the ballistic regime of the system. Only when it starts the collision process will its path start to resemble a diffusive process, represented by the linear behaviour. The ballistic regime is less apparent in the MSD for liquids because atoms are found closer together and quickly collide, transiting to the diffusive regime. However, in a gaseous system, the atoms are further apart and each atom takes a longer time before a collision.&lt;br /&gt;
&lt;br /&gt;
In calculating the diffusion coefficient, we disregard the ballistic dynamics and only use the gradient from the last 2000 timesteps corresponding to the diffusive regime. In Equation 3, the &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; term corresponds to the gradient of the MSD vs timestep graph, with  &amp;lt;math&amp;gt;r(t)&amp;lt;/math&amp;gt; computed in terms of σ=0.34nm, and &amp;lt;math&amp;gt;{\partial t}&amp;lt;/math&amp;gt; corresponding to a timestep of 0.002fs used in this simulation.&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the MSD vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Gradient&lt;br /&gt;
!D (σ&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;0.002fs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|5.07 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.45 x 10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|1.05 x 10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.75 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|9.37 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|1.56 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|18.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the timestep for the million atom simulation is not known - the diffusion coefficient cannot be calculated. However, there are a few salient points when comparing with the normal simulation. First, the MSD fluctuates to a smaller extent in the million atom system, allowing us to obtain a more accurate value for the diffusion coefficient. This is illustrated most clearly in the solid simulation, where a larger system size equilibrates at a constant MSD value with lesser fluctuations. Second, the trend of diffusion coefficients increasing when moving from solid to liquid to gas is consistent with that of the normal simulation, as decreasing density increases the distance between atoms and allows for a greater deviation of an atom from its initial position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Method 2: Velocity Autocorrelation Function ====&lt;br /&gt;
[[File:Jw7815VACFsolliqgas.png|480px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: VACF against timestep for solid, liquid, and gas ]]&lt;br /&gt;
[[File:Jw7815VACF.png|480px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a 1D harmonic oscillator when w=1/2π ]]&lt;br /&gt;
[[File:Jw7815VACF million.png|480px|thumb|left|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: VACF against timestep for solid, liquid, and a gas for a million atom simulation ]]&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function (VACF), &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, tells us how the velocity of an atom at time t, &amp;lt;math&amp;gt;\mathbf{v}(t)&amp;lt;/math&amp;gt; differs from its velocity at a different time, &amp;lt;math&amp;gt;\mathbf{v}(t+\tau)&amp;lt;/math&amp;gt;. Mathematically, they are related through:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating VACF then gives us the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Gas =====&lt;br /&gt;
In non-interacting systems a constant VACF is expected, as particles retain their velocity. If the interaction is weak but not negligible, then each atom would experience a gradual change in its magnitude and direction and slowly de-correlate with time. This explains the behaviour seen in a gas, where the VACF decreases steadily. &lt;br /&gt;
&lt;br /&gt;
===== Solids and Liquids =====&lt;br /&gt;
If the interaction is strong, like in a solid or liquid, atoms tend to oscillate at the bottom of the LJ well where there is a balance between repulsive and attractive forces. This gives rise to the periodic oscillation from positive to negative values seen for solids (and very slightly for liquids). For solids, the atoms are held in fixed lattice positions and do not diffuse, therefore the oscillations are not dampened by diffusive motion (the dampening observed is due to other perturbative forces), however liquids do not have fixed positions and the atoms slide over each other frequently, and the diffusive motion results in a rapid disruption of the oscillatory behaviour, resulting in the VACF for the liquid decaying to zero after one minima. &lt;br /&gt;
&lt;br /&gt;
===== 1D Harmonic Oscillator =====&lt;br /&gt;
The VACF for a normalised harmonic oscillator in one dimension is given by (derivation in appendix):&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VACF for the solid and liquid simulations are shown in Figure 8 together with the VACF for the harmonic oscillator when &amp;lt;math&amp;gt; \omega = \frac {1}{2 \pi} &amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
The magnitude of oscillation is constant and greater than that observed for both solid and liquid. This follows naturally from the oscillatory behaviour about the potential well, which is unaffected by perturbative forces, therefore no dampening is observed.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACF provides insight into the collision dynamics of the system. Mathematically, the minima relates to the maximum change in the magnitude or direction of atoms in the system. The physical interpretation of this is that the first minima corresponds to the time in which all the atoms in the system have collided at least once.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from Equation 5, using the trapezeium rule to obtain the integrals, and summarised below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:center; margin-center: 10px; width:600px; text-align:center;&amp;quot;&lt;br /&gt;
|+Table 1: &#039;&#039;&#039;Diffusion coefficients obtained from the gradient of the VACF vs timestep graphs&#039;&#039;&#039;&lt;br /&gt;
!&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!Area under Curve/Integral&lt;br /&gt;
!D (cm&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; s)&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
|216.369&lt;br /&gt;
|176.919&lt;br /&gt;
|9.77 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|233.964&lt;br /&gt;
|155.586&lt;br /&gt;
|0.202&lt;br /&gt;
|-&lt;br /&gt;
!Gas&lt;br /&gt;
|12670.514&lt;br /&gt;
|4902.699&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
Like in the MSD case, the million atom simulation shows less fluctuation than the normal simulation, and a more accurate value of VACF is obtained. The largest source of error in the VACF estimate for the diffusion coefficient arise from the numerical method used to evaluate the integral. While the trapezium method provides a good estimate, values are lost in each step of the calculation. In addition, the VACF is a slowly decaying function, therefore the tail contributes a significant amount to the integral, increasing the inaccuracy of the value obtained.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclusions - tie up the research and what your results show. Reread &lt;br /&gt;
your intro, what are you trying to do? How does your research do this&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;br&amp;gt; Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== VACF derivation for a 1D Harmonic Oscillator&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x = Acos(\omega t) \ \ (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf{v} = \frac{dx}{dt} = -A\omega sin(\omega t) \ \ (7) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that the normalised VACF is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \ \ (8)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitution of &amp;lt;math&amp;gt;(7)&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;(8)&amp;lt;/math&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \mathbf{v}\left(t\right)\mathbf{v}\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \mathbf{v}^2\left(t\right)\mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right) \left( -\mathrm{A} \omega \sin\left( \omega t + \omega\tau \right) \right) \mathrm{d}t}{\int_{-\infty}^{\infty} \left( -\mathrm{A} \omega \sin\left( \omega t \right) \right)^2 \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= \frac{\int_{-\infty}^{\infty}  \sin\left( \omega t \right) \sin\left( \omega t + \omega\tau \right) \mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t}&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expanding the second term in the numerator using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\begin{align}[rcl]&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \sin(\omega t)[\sin(\omega t)\cos(\omega \tau) + \sin(\omega \tau)\cos(\omega t)]\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(\omega t)cos(\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty}  {\sin}^2 \left( \omega t \right) \mathrm{d}t} \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \frac{1}{2}\sin(2\omega t)\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2}[{\cos} \left(2 \omega t \right)-1]\mathrm{d}t} \\&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;amp;= cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} \\&lt;br /&gt;
&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral &amp;lt;math&amp;gt; \frac{\int_{-\infty}^{\infty} \sin(u)\mathrm{d}u}{\int_{-\infty}^{\infty} {\cos} \left(u \right)-1\mathrm{d}u} &amp;lt;/math&amp;gt; will tend to zero, hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \left(\omega \tau \right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc. Questions ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction to Molecular Dynamics Simulation ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Velocity-Verlet Algorithm =====&lt;br /&gt;
[[File:Jw7815Verlocityverlet.png|480px|thumb|right|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[[File:Jw7815Verlet1%.png|480px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Verlet blabla of sin(x) between 0 and &amp;lt;math&amp;gt;2\pi&amp;lt;/math&amp;gt;]]&lt;br /&gt;
Using the velocity-Verlet algorithm to model the behaviour of the classic harmonic oscillator (Figure 1), we see a good fit between the analytical data modelled by the harmonic oscillator and the velocity-Verlet solution (top graph). The error, given by the absolute difference between the analytical result and that modelled by the velocity-Verlet solution, shows a series of maximums of increasing amplitude (bottom graph). The positions of the maxima in the error function can be linearly represented by the Equation 1, and shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{y} = 0.00042155x\mathbf{x} - 0.000073022  \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the error is at a minimum value, it corresponds to a maximum energy value of 0.500, suggesting that the true energy value of the system is 0.500. In contrast, when the error is at a maximum, it corresponds to the minimum of the energy function - the exact value of the minimum will depend on the timestep used. When timestep is increased, the error maxima increase at a greater rate as compared to a lower timestep, resulting in a greater amplitude of fluctuation in the energy. This is illustrated in Figure 2, where a higher timestep of 0.2 results in greater fluctuation in energy. This vale is also is the maximum threshold to obtain an error in energy of less than 1%, where the energy (0.5) experiences a maximal fluctuation of 0.05.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because when a system has equilibrated, the total energy should remain constant, indicating that energy has been completely redistributed amongst the colliding particles in the system.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Atomic Forces =====&lt;br /&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;, when the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero:&lt;br /&gt;
&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and force is at the regime where repulsion dominates.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force is zero, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = -48\epsilon\sigma^{12}(\frac {1}{r^{13}})+ 24\epsilon\sigma^{6}(\frac {1}{r^{7}})=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{r_{eq}^{7}}= 2\sigma^{6}(\frac {1}{r_{eq}^{13}})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_eq = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt; r_{eq} = 2^\frac {1}{6} \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( - \frac{\sigma^{12}}{11 r^{11}} + \frac{\sigma^6}{5 r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^{5}} \right)&amp;lt;/math&amp;gt;. Hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}[rcl]&lt;br /&gt;
\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;=  -4\left( \frac{1}{11 \times 2^{11}} - \frac{1}{5 \times 2^{5}} \right) &amp;amp; \approx 0.0248 \\&lt;br /&gt;
\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 2.5^{11}} - \frac{1}{5 \times 2.5^{5}} \right) &amp;amp; \approx 0.0082 \\&lt;br /&gt;
\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= -4\left( \frac{1}{11 \times 3^{11}} - \frac{1}{5 \times 3^{5}} \right) &amp;amp; \approx 0.0033 &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3a: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Under standard conditions, water has a density of &amp;lt;/span&amp;gt;ρ&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; = 1 g/mL and molar mass of water = 18.0153 g/mol. Therefore for 1 mL = 1 g of water, the number of moles&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt; of 1ml water = m/M&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 0.0555084 mol, and the n&amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;umber of water molecules = nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 3.343 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;For 10000 water molecules, n of water = 1.661 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol, &amp;lt;/span&amp;gt;&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;mass of water = nM&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; = 2.992 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g. Hence volume of water = 2.992 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 3b: Periodic Boundary Conditions =====&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;Final atom position = &amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span lang=&amp;quot;EN-GB&amp;quot;&amp;gt;After applying periodic boundary conditions, any coordinate greater than 1.0 will be translated in the negative direction by 1.0, we end with coordinate = &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Reduced Units =====&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2(0.34)( 10^{-9}) = 1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq}) = \epsilon = (k_{B}T)(N_A) = (1.38065  \times  10^{-23})(6.022  \times  10^{23})  = 997.73546 \;\mathrm{J\;mol^{-1}} = 0.998 \;\mathrm{kJ\;mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac {T^{*}\epsilon}{k_B} = 1.5 \times 120 \;\mathrm{K} = 180 \;\mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibration ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Creating a Simulation Box =====&lt;br /&gt;
In simulations, atoms which are generated by the &#039;&#039;random &#039;&#039;style may be highly overlapping, causing many interatomic potentials to be computed as large energies and forces which would blow atoms out of the simulation box, causing LAMMPS to return an error. This can be avoided by imposing a limit on the maximum distance an atom can movie in a single timestep by using the fix nve/limit command, this allows the system to equilibrate at the energy minimum. Alternatively, the positions of the atom can be pre-defined by a known lattice type before running the simulation.&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Lattice Types =====&lt;br /&gt;
[[File:Jw7815Lattice types.jpg|320px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Different lattice types with different arrangement of atoms within each unit cell image from https://wps.prenhall.com/wps/media/objects/3082/3156196/blb1107/bl11fg33.jpg]]&lt;br /&gt;
Different lattice types can be used to pre-define the position of atoms before a simulation. In these cubic lattice, the number density, &amp;lt;math&amp;gt;\rho = \frac {N}{V}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms per unit cell and the volume,&amp;lt;math&amp;gt;V = L^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, in the simple cubic (sc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8)=1 &amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{1}{0.8}=1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 1000 atoms for the simulation, since each unit cell contains 1 atom&lt;br /&gt;
&lt;br /&gt;
For a face-centered cubic (fcc), each unit cell contains &amp;lt;math&amp;gt;N= (\frac {1}{8})(8) + (\frac {1}{2})(6) =4&amp;lt;/math&amp;gt;, if the number density, &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;math&amp;gt;L=\sqrt[3]\frac{4}{1.2}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a box containing 1000 unit cells (and hence 1000 lattice points) is created, the &#039;&#039;create_atom&#039;&#039; function will generate 4000 atoms for the simulation, since each unit cell contains 4 atoms.&lt;br /&gt;
&lt;br /&gt;
===== Task 3: Properties of Atoms =====&lt;br /&gt;
After defining the position of the atoms, the properties were assigned using the following commands.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: defines type 1 atoms as having a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: specifies a standard Lennard-Jones potential with no Coulomb between atom pairs, with global LJ cutoff set to distance &amp;lt;math&amp;gt;r=3.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: sets the pairwise forcefield coefficients for the symmetric I,J interaction to the same value of 1.0 for all (given by asterisk) type 1 with type 1 atom pairs&lt;br /&gt;
&lt;br /&gt;
===== Task 4: Choice of Algorithm =====&lt;br /&gt;
Since the &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; will be specified in this simulation, the velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===== Task 5: Running a Simulation =====&lt;br /&gt;
Total time = timestep x number of timesteps. By defining the timestep and number of timesteps as a variable, we only need to change the timestep when running different simulations, and the number of timesteps will change correspondingly according to the formula to keep the total time constant. For the alternative input, which already specifies both timestep and number of timesteps, upon changing the timestep, we have to manually calculate the number of steps and input them for each different simulation to ensure that the total time remains the same.&lt;br /&gt;
&lt;br /&gt;
===== Task 6: Checking Equilibration =====&lt;br /&gt;
[[File:Jw78150.001 sim.png|280px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Total Energy, Pressure, and Temperature against time when a timestep of 0.001 is used. Time is shown up to 1s to illustrate the point of equilibration.]]&lt;br /&gt;
[[File:Jw78150.001energyonly.png|320px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Total Energy against time when a timestep of 0.001 is used]]&lt;br /&gt;
[[File:Jw7815EQUIalle.png|320px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Comparison of Total Energy against time at different timesteps]]&lt;br /&gt;
From Figure 15, we observe that an equilibrium energy value of -3.1482 is reached at a very early stage in the simulation with a timestep of 0.001. An expanded view showing the the first second of the simulation for the energy, temperature and pressure is shown in Figure 14, and it can be seen that equilibrium values are reached at approximately 0.38 seconds.&lt;br /&gt;
&lt;br /&gt;
In simulations, shorter timesteps allow us to obtain more accurate calculations, although it can be costly and time-consuming to run such calculations. On the other hand, longer timesteps result in less accurate calculations. This balance is illustrated in Figure 16. When a long timestep of 0.015, the system stabilises at a minimum energy (at a value higher than the true vaue), but shortly after experiences a blowup as the errors start to propagate out of control, and therefore is a completely unacceptable timestep.&lt;br /&gt;
&lt;br /&gt;
As the timestep decreases, an equilibrium is reached (0.01 and 0.0075), although it does not reach the true value of -3.184. Finally, as we further decrease the timestep to 0.0025, we see that a satisfactory value is obtained, which is identical to the most accurate value calculated at even lower timesteps. The balance in this simulation is thus to use a timestep of 0.0025, as it is high enough to avoid the high cost and time of simulations, yet low enough to obtain an acceptable calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running Simulations under Specific Conditions ====&lt;br /&gt;
&lt;br /&gt;
===== Task 1: Thermostats and Barostats =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Task 2: Examining the Input Script =====&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;/pre&amp;gt;For the command ave/time, 100, 1000 and 100000 corresponds to &#039;&#039;Nevery&#039;&#039;, &#039;&#039;Nrepeat&#039;&#039;, and &#039;&#039;Nfreq&#039;&#039; respectively. These arguments specify on what timesteps the input values will be used in order to contribute to the average. Specifically, the final averaged quantities are generated on timesteps that are a multiple of &#039;&#039;Nfreq&#039;&#039;, and the average is over &#039;&#039;Nrepeat &#039;&#039;quantities, computed in the preceding portion of the simulation every &amp;lt;em&amp;gt;Nevery&amp;lt;/em&amp;gt; timesteps.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jw7815</name></author>
	</entry>
</feed>