<?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=Npj12</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=Npj12"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Npj12"/>
	<updated>2026-05-16T07:18:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544587</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544587"/>
		<updated>2016-02-29T14:03:43Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 5- Monitoring thermodynamic properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not periodic - periodic means &amp;lt;math&amp;gt;x(t) = x(t+T)&amp;lt;/math&amp;gt;, for some period T.&amp;lt;/span&amp;gt;&#039;&#039;&#039; and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: ellipse&amp;lt;/span&amp;gt;&#039;&#039;&#039;, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Excellent, very thorough presentation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, we&#039;re not doing that. It is common though, well researched. The shifted version is usually called the &amp;quot;truncated and shifted LJ potential&amp;quot;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544586</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544586"/>
		<updated>2016-02-29T14:03:05Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 3 and 4- Setting atomic physical properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not periodic - periodic means &amp;lt;math&amp;gt;x(t) = x(t+T)&amp;lt;/math&amp;gt;, for some period T.&amp;lt;/span&amp;gt;&#039;&#039;&#039; and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: ellipse&amp;lt;/span&amp;gt;&#039;&#039;&#039;, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Excellent, very thorough presentation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, we&#039;re not doing that. It is common though, well researched. The shifted version is usually called the &amp;quot;truncated and shifted LJ potential&amp;quot;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544579</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544579"/>
		<updated>2016-02-29T13:56:28Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 6- Reduced Quantities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not periodic - periodic means &amp;lt;math&amp;gt;x(t) = x(t+T)&amp;lt;/math&amp;gt;, for some period T.&amp;lt;/span&amp;gt;&#039;&#039;&#039; and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: ellipse&amp;lt;/span&amp;gt;&#039;&#039;&#039;, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Excellent, very thorough presentation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, we&#039;re not doing that. It is common though, well researched. The shifted version is usually called the &amp;quot;truncated and shifted LJ potential&amp;quot;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544578</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544578"/>
		<updated>2016-02-29T13:54:06Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 3- The Lennard-Jones Potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not periodic - periodic means &amp;lt;math&amp;gt;x(t) = x(t+T)&amp;lt;/math&amp;gt;, for some period T.&amp;lt;/span&amp;gt;&#039;&#039;&#039; and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: ellipse&amp;lt;/span&amp;gt;&#039;&#039;&#039;, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Excellent, very thorough presentation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544526</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544526"/>
		<updated>2016-02-27T19:21:33Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not periodic - periodic means &amp;lt;math&amp;gt;x(t) = x(t+T)&amp;lt;/math&amp;gt;, for some period T.&amp;lt;/span&amp;gt;&#039;&#039;&#039; and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: ellipse&amp;lt;/span&amp;gt;&#039;&#039;&#039;, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Excellent, very thorough presentation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544525</id>
		<title>Talk:Mod:ThirdyearPSRWliquidsimulationsexp</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ThirdyearPSRWliquidsimulationsexp&amp;diff=544525"/>
		<updated>2016-02-27T17:58:28Z</updated>

		<summary type="html">&lt;p&gt;Npj12: Created page with &amp;quot;== Introduction to Molecular Dynamics Simulation == The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
The aim of this report is to demonstrate how Molecular Dynamics can be used as a powerful tool to model a simple Lennard-Jones fluid initially in the canonical ensemble [N, V, T] and then subsequently in the isobaric ensemble [N, P, T]. The systems modelled are entirely classical which is why MD, a simple stochastic method is used. The simulations involved will utilize periodic boundary conditions when choosing a simulation box containing N atoms; assigning each atoms initial positions and velocities such that the system is as close to equilibrium as possible (this is a result of comparing the total kinetic energy to the equipartition principle), and finally measuring any desired thermodynamic quantities. Monitoring a system&#039;s velocities and computing the total kinetic energy is computationally costly, however algorithms such as the Velocity-Verlet&amp;lt;ref&amp;gt;L. Verlet, Phys. Rev.159, 98 (1967)&amp;lt;/ref&amp;gt; (used extensively in this report), use a neighbouring list technique which reduces the time taken. Short references to the underlying theory will be invoked and simulations of the vapour, liquid, solid and super-critical states of the fluid will be modelled, its limitations discussed, and this will be compared to the as the equation of state/ideal gas model. Finally Radial Dstribution Functions (RDF&#039;s) and Velocity Autocorrelation Functions (VACF&#039;s) of each phase will be analysed and structural properties identified.&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1, 2 and 3- The Velocity-Verlet algorithm vs. Analytical simple harmonic oscillator  ===&lt;br /&gt;
We consider the 1D classical harmonic oscillator limiting case; We shall observe the system where the angular frequency ω = 1.0 and phase factor ϕ = 1.0. The particle position x(t) is given by the following formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;Data from the file &#039;HO.xls.&#039; was retrieved and contains three columns.&lt;br /&gt;
# ANALYTICAL- the exact value for the velocity v(t) for the classical harmonic oscillator&lt;br /&gt;
# ERROR- the absolute error between the analytical and velocity-varlet solution&lt;br /&gt;
# ENERGY- the total energy for the classical harmonic oscillator determined from Velocity-Verlet results&lt;br /&gt;
The initial time-step given in the file was 0.1. The total energy for the harmonic oscillator is given by its time-dependent kinetic and potential energy contributions specified in the formula;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = K(t) + U(t) = \frac{1}{2} mv^2(t) + \frac{1}{2} k x^2(t)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The results for the position and total energies as a function of time are shown in the gallery below.&amp;lt;gallery mode=packed heights=150px&amp;gt;&lt;br /&gt;
0.1positionpsrw.PNG|figure 1; position as function of time for the analytical harmonic oscillatorr and the Velocity-Verlet Algorithm, Δt=0.1&lt;br /&gt;
0.1etotalpsrw.PNG|figure 2; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;The positions calculated by the analytical harmonic oscillator and the Velocity-Verlet algorithm are the same. These values of position x(t) were then inputted into algorithm and the total energy was computed using equation (2). The total energy of an isolated simple harmonic oscillator should remain constant and only the individual kinetic and potential energy contributions vary. The Velocity-Verlet algorithm utilises molecular dynamics based upon simple Newtonian Mechanics to calculate a trajectory of the oscillating particle. However classical mechanical variables such as velocity are time-reversible and continuos in time and space whereas the variables in the algorithm have been discretised. Despite this difference it is observed that the mean energy should still be conserved in the discrete mechanics utilised in our the simulation and as such one of the key tests of accuracy for these trajectories is that the conservation of energy principle should be upheld and the total energy should hold a constant value. From figure 2 we can see the total energy follows a cosinusoidal function about an average value of 0.499 in reduced units with a maximum percentage error of 0.2%.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:0.1absoluteerrorpsrw.PNG|figure 3; Absolute error as a function of time, Δt=0.1&lt;br /&gt;
File:0.1errormaxpsrw.PNG|figure 4; Error maxima as a function of time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;From figure 3 is it seen that the absolute error between the analytical harmonic oscillator and that determined by the Velocity-Verlet algorithm is both periodic and increases in magnitude with time. The maximum error of the algorithm increasing as a function of time because the trajectory used is calculated by iteration. This could be better visualized in [x(t), v(t)] phase-space where the analytical periodic solution would appear as a circle, but the Velocity-Verlet solution would appear similar to a Fibbonaci expansion, increasingly determining a trajectory with more deviation after each time-step. At each time-step a new trajectory point is established using the previous one and as such errors are compounded and increase with the number of time-steps simulated. The increase in maximum error is quantified in figure 4 by isolating each peak in figure 3 producing a linear plot. The straight line equation %E&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;(t) = 0.0422t - 0.0073 demonstrates this behaviour. The periodicity can be explained simply by taking into account the periodic energy of the system and as such the errors incurred in the MD trajectory used by the algorithm at nearly periodic time spacing will still calculate the exact same energy as the analytical solution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:0.2etotalpsrw.PNG|figure 5; Velocity-Verlet Total Energy vs. Time, Δt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Experimenting with different values of the time-step in the Velocity-Verlet algorithm demonstrates that a more accurate iteration is achieved when a smaller time-step is used. Figure 5 shows the total energy as a function of time when this increases to 0.2, the maximum deviation in the total energies calculated over the simulation  was 1.0%. Therefore using a time-step of less than 0.2 is required to keep the maximum deviation under this value, the importance of this is such that the simulation obeys the conservation of energy as discussed before and a more accurate average value will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Lennard-Jones Potential ===&lt;br /&gt;
The equation for the empirical Lennard-Jones two body interaction potential is;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;The potential is characterized by a steep repulsion at internuclear distances ≤ σ, where σ is the radial distance between the two bodies in direct contact. The potential also consists of a favourable potential well characterized by its well-depth -ε, and its asymptotic behavior whereby the potential V(r) →0 as r→∞.&lt;br /&gt;
&lt;br /&gt;
The relationship between a force and its corresponding Lennard-Jones potential is given by;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{V\left(r\right)}{\mathrm{d}\mathbf{r}}= 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;1.To find the equilibrium seperation this derivative is set equal to zero and the corresponding equation solved for r. The working is as follows;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right) = 0,    \frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple equating of terms and rearrangement yields the solution &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.  To find the potential at equilibrium (well-depth), of which will be a stable minima, is achieved by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into our original equation for the Lennard-Jones potential.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left({12\sigma^{12}}{(2^\frac{1}{6}\sigma)^{-12}} - {6\sigma^6}{(2^\frac{1}{6}\sigma)^{-6}}\right) = 4\epsilon \left(\frac{1}{4}-\frac{1}{2}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
3. To find the separation &amp;lt;math&amp;gt;r_{o}&amp;lt;/math&amp;gt; where the Lennard-Jones potential is equal to zero, the LJ potential equation set equal to zero, then dividing by ε, equating the resultant terms and solving for r. This yields the solution &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. The corresponding force at this internuclear separation is found by substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; into the original &amp;lt;math&amp;gt;\mathbf{F} = -\frac{V\left(r\right)}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt; equation. &lt;br /&gt;
&lt;br /&gt;
This yields &amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left({12\sigma^{12}}{\sigma^{-13}} - {6\sigma^6}{\sigma^{-7}} \right)&amp;lt;/math&amp;gt;, where the σ&#039;s, excluding one on the denominator for each term cancel, by rearrangement &amp;lt;math&amp;gt;\mathbf{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. The following integrals are evaluated where σ = ε = 1.0 such that &amp;lt;math&amp;gt; V(r) = 4\varepsilon \left[ {r^{-12}} - {r^{-6}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty V\left(r\right)\mathrm{d}r = 4\int_{2\sigma}^\infty \left[ {r^{-12}} - {r^{-6}}\right]\mathrm{d}r = 4\left[-\frac{r^{-11}}{11}+\frac{r^{-5}}{5}\right]^{\infty}_{2\sigma}=-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 and 5- Periodic Boundary Conditions for MD simulations ===&lt;br /&gt;
An example physical system looking to be modelled consists of 1ml of water under standard conditions- T = 298.15K, P= 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;Pa.&lt;br /&gt;
&lt;br /&gt;
The Molecular weight of water = 18.015gmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; and under standard conditions has a density ρ = 0.9970gml&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, therefore in 1ml there is 1g of water.&lt;br /&gt;
&lt;br /&gt;
Therefore the number of molecules of water in 1ml is calculated; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n= \frac{m}{Mr}=\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt; and therefore no.molecules N = 0.056mol * 6.023x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 3.343x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Calculating the volume of  10000 molecules of water under standard conditions;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math&amp;gt;m= \frac{\rho}{V} = nMr = \frac{10000Mr}{Na} &amp;lt;/math&amp;gt;therefore by rearrangement it is found that V = 2.983x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;ml&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
During all the MD simulations carried out in this report periodic boundary conditions (PBC&#039;s) are applied. This is because it is not possible to simulate realistic volumes of fluids as these contain nN&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; numbers of molecules and therefore the same number of individual Newtonian dynamic second order linear differentia equations to compute. Because of this PBC&#039;s are chosen to approximate large bulk system behaviour. PBC&#039;s utilise a minimum image and a repeated zone of which is repeated in every translational axis about a simulation box. A given molecule A will interact with all other molecules inside the the simulation box, generally equating to 10&amp;lt;sup&amp;gt;1-2&amp;lt;/sup&amp;gt; pair-wise interactions. This reduces the computational time needed for simulation.  The use of a repeated zone also means that molecules that would have been near the simulation box walls don&#039;t have a perturbed fluid structure. The system is feasible because if a molecule leaves the simulation box another identical molecule enters on the opposite side such that the total number is constant.&lt;br /&gt;
&lt;br /&gt;
An example to demonstrate PBC&#039;s in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1.0, 1.0, 1.0\right)&amp;lt;/math&amp;gt; is for an atom A at starting position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in that travels along a vector path defined by &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as the atom hits the boundary of the simulation box in the x and y directions it is immediately reflected onto the opposite side of the box. This effect is orthonormal along the axes and as such the atom never encounters the z-face. Therefore at the end of the time-step the final position of the atom is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Reduced Quantities ===&lt;br /&gt;
In all the MD simulations conducted in this report reduced quantities are utilised to make data value magnitudes more manageable. This various reduced quantities are calculated by division by a known scalar for example;&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;  energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt; temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example Argon; &lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma = 0.34nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt; therefore the well-depth = 1.656x10&amp;lt;sup&amp;gt;-24&amp;lt;/sup&amp;gt;KJ =  0.998KJmol&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r_c^{*}=\frac{r_c}{\sigma}&amp;lt;/math&amp;gt; therefore the Lennard-Jones cutoff point &amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; = 1.088nm in real units&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;T^{*} = 1.5&amp;lt;/math&amp;gt; therefore using the value for the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; calculated, the temperature in real units is equal to &amp;lt;math&amp;gt;T=\frac{\epsilon T^{*}}{k_{B}} &amp;lt;/math&amp;gt; = 180K&lt;br /&gt;
A note on the LJ-cutoff point: When carrying out MD simulations it is advisable to truncate the inter-nuclear distance of interaction to avoid an excessive number of pair-wise interactions being simulated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
   \displaystyle &lt;br /&gt;
   V_{{LJ}_{trunc}}&lt;br /&gt;
   (r)&lt;br /&gt;
   :=&lt;br /&gt;
   \begin{cases}&lt;br /&gt;
      V_{LJ} (r)&lt;br /&gt;
      -&lt;br /&gt;
      V_{LJ} (r_c)&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r \le r_c&lt;br /&gt;
      \\&lt;br /&gt;
      0&lt;br /&gt;
      &amp;amp;&lt;br /&gt;
      \text{for } r &amp;gt; r_c.&lt;br /&gt;
   \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is both useful to save computational time and is justified because the LJ r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;(repulsive) and r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; attractive terms both decay rapidly as r increases. The truncated LJ potential is achieved via a cutoff distance r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;, generally around the magnitude of 2.5σ as this is approximately equivalent to &amp;lt;math&amp;gt;\frac{1}{60}&amp;lt;/math&amp;gt; of the minimum potential well-depth of -ε. Therefore after this cutoff distance the pair-wise interaction can be considered insignificant within the precision of the simulations undertaken and are assigned a value of 0. Furthermore a jump dicontinuity in the potential energy is avoided as the LJ is shifted upward such that at the cut-off radius it is exactly equal to zero.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 and 2- Choosing initial atomic positions  ===&lt;br /&gt;
The MD simulations run using the Velocity-Verlet algorithm require a trajectory to be calculated for each individual particle. This therefore requires the computation of the same number of second order linear differential equations such that each is an initial value problem. When modelling a solid system this is easily done by using knowledge of a crystals lattice structure and motif and then using its inherent infinite translational symmetry. &lt;br /&gt;
&lt;br /&gt;
For example considering a simple primitive cubic lattice where each equivilent lattice vector/unit cell side length x,y and z = a = 1.07722 in reduced units, atomic positions lie on each edge of the cell. As a result the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Each simple cubic lattice unit cell contains the equivalent of 1 atom due to sharing with neighboring cells and therefore the density of the cell;&amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.80&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An FCC (face-centered cubic) lattice on the other hand contains the equivalent of 4 atoms per unit cell. If such a crystal had an intrinsic density of 1.2 the lattice vectors can be calculated as follows;&amp;lt;math&amp;gt;\rho=\frac{4}{a^{3}}=1.20&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt;a = 1.494.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When calculating trajectories of solid crystalline systems an input file containing the following lines is used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an orthogonal geometric region, the simulation box, a cube consisting of 10 lattice-spacing&#039;s along each axis. This corresponds to a box of 1000(10x10x10) unit cells, 10 along each Cartesian axis, and therefore in the case of a cubic lattice will contain 1000 lattice points which will be filled with atoms later. Analogously as mentioned before an FCC lattice unit cell contains four times as many atoms per unit cell so upon the same treated in the input file 4000 lattice points would be generated and 4000 atoms simulated.&amp;lt;gallery mode=packed heights=190px&amp;gt;&lt;br /&gt;
File:pcpsrw.PNG|figure 6; Primitive cubic lattice unit cell, lattice vector a&lt;br /&gt;
File:fccpsrw.PNG|figure 7; Face-centered cubic lattice unit cell, lattice vector a&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However for this report a Lennard-Jones fluid with no long-range order or single reference cell for the simulation box is modelled. It is possible to simply compute random atomic starting coordinates in the simulation box. However this can cause major problems for the resulting time-evolving trajectories especially in large/dense systems where there would be a large probability of two atoms initially being positioned within each-others excluded volume such that r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. The resulting initial overlap is catastrophic especially for a LJ-fluid because of its very strong short-range repulsive term. The subsequent system energy would increase rapidly and would be highly unrealistic and lead to large errors which could not be rectified. This is analogous using a time-step that is too large as similar highly repulsive interactions would occur over time. The initial configurations are crucial as the system is only simulated for a short time frame and therefore a starting configuration close to equilibrium needs to be ensured for an accurate MD simulation i.e. need to start near a local PE minima.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 and 4- Setting atomic physical properties ===&lt;br /&gt;
Using the LAMMPS manual the following input file lines of code are explained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;mass&#039;&#039;&#039;&#039; sets the mass for all the atoms (≥1 types).&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;mass I value&#039;: where &#039;&#039;&#039;I- atom type&#039;&#039;&#039; and &#039;&#039;&#039;value- mass.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;1 specifies there is only one atom type in the lattice &#039;&#039;&#039; and &#039;&#039;&#039;1.0 species the mass values of all of these atoms as unity.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_style&#039; &#039;&#039;&#039; sets the formula(s) LAMMPS uses to compute pairwise interactions. LAMMPS pairwise interactions are defined between atomic pairs within a cutoff distance as discussed before, generally r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;≈2.5σ, this cutoff can take an arbitary value smaller of greater than the simulation box dimensions. The function therefore sets the active interactions which evolve with time.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair-style style args&#039;: where &#039;&#039;&#039;style- one of the styles/pairwise potentials in LAMMPS&#039;&#039;&#039; and &#039;&#039;&#039;args- arguments used by that particular style.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Therefore &#039;&#039;&#039;lj/cut specifies a Lennard-Jones potential with a cutoff at 3.0σ and no Coulombic potential.&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;The command &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;pair_coeff&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; specifies the pairwise force field coefficients for one/more pairs of atom types, with the number and meaning being dependent on the pair&#039;&#039;&#039;_&#039;&#039;&#039;style chosen. The command is  written after the pair&#039;&#039;&#039;_&#039;&#039;&#039;style command and modifies the cutoff region for all atomic pairs such that it holds for the entire LJ potential computed.&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;pair&#039;&#039;&#039;_&#039;&#039;&#039;coeff I J args&#039;: where &#039;&#039;&#039;I,J- specify atom types&#039;&#039;&#039; and &#039;&#039;&#039;args- coefficients  for  ≥1 atom types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the line of code used &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; * *&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; specifies no numerical value and that all atom pairs within the lattice (n→N) are to be specified&#039;&#039;&#039; and &#039;&#039;&#039;1.0 1.0 specifies the LJ force field coefficients.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the MD simulations the Velocity-Verlet integration algorithm is utilized as the &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified in the initial value problem. Specifying the initial velocity is easy as simulations will occur at thermodynamic equilibrium and as such obey Maxwell-Boltzmann statistics. This is computed by choosing random velocities where the total CoM = 0 and re-scaling to fit the desired system temperature given by statistical mechanics and the equipartition principle in the classical limit.&lt;br /&gt;
&lt;br /&gt;
=== Task 5- Monitoring thermodynamic properties ===&lt;br /&gt;
When running MD simulations it is useful to monitor how properties change dependent on the time-step trajectories are calculated from. It is therefore useful to code the input file using following the second chunk of code compared to the first.&lt;br /&gt;
1)&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the timestep can be stored as a varible, which is then used in the 3rd line second line of code. This line allows for the different timesteps to simulate for exactly the same overall time in reduced units. For example, setting n_steps equal to 100/timestep tells LAMMPS to simulate for one-hundred thousand steps, when the variable is set to 0.001 and this corresponds to a total time of 100. By analogy for a timestep of 0.002 this would correspond to n_steps = fity-thousand, but crucially the overall time simulated would still be 100. In contrast the first chunk of code would simply simulate for a time equal to the timestep chosen multiplied by the 100000, from the line &#039;run 100000&#039; and result in different simulation times for different timesteps. This is undesirable as modifying the timestep and comparing results on the same x-axis is crucial to determining the optimum timestep value. Note the floor function is used in case the 100/timestep output is not an integer and rounds this down.&lt;br /&gt;
&lt;br /&gt;
=== Visualizing trajectories ===&lt;br /&gt;
Time evolving MD trajectories are monitored using VMD software. Figures 8 and 9 demonstrate this when applied to a simple cubic lattice at t=0 and then at a later time. Figure 10 shows it is possible to visualize two individual particle trajectories and the PBC&#039;s used were clearly seen as atoms dissapeared and reappeared at opposite sides of the simulation box.&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:first trajectory, perfect cubic lattice- t=0psrw.PNG|figure 8; simple cubic lattice at t=0&lt;br /&gt;
File:VDW Intro trajectory visualizationpsrw.PNG|figure 9; simple cubic lattice at t=nΔt=0.1&lt;br /&gt;
File:tracking individual particlespsrw.PNG|figure 10; simple cubic lattice individual particles at t=nΔt=0.1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 6- Checking equilibrium ===&lt;br /&gt;
MD trajectories for Δt=0.001 are calculated and plots for the total energy, pressure and temperature as a function of time are shown below. In all three cases the system reached equilibrium as each thermodynamic property started to fluctuate about a constant average value within the simulation timescale. Due to MD&#039;s stochastic nature the values continually fluctuate about these values in a Gaussian fashion. Specifically all these properties reached equilibrium after t=0.3. This is demonstrated by their average values being equal to the linear fit y-intercept.&amp;lt;gallery mode=packed heights=220px&amp;gt;&lt;br /&gt;
File:0.001etotalvtpsrw.PNG|figure 11;Total energy vs. time, Δt=0.001&lt;br /&gt;
File:0.001pvtpsrw.PNG|figure 12;Pressure vs. time, Δt=0.001&lt;br /&gt;
File:0.001tempvtpsrw.PNG|figure 13;Temperaturevs. time, Δt=0.001&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Choosing the optimum timestep requires a balance to be struck between computational efficiency when modelling a long timescale, and simulation accuracy. A smaller timescale will reflect the physical reality of the systems pair-wise interactions most accurately. However larger timesteps are useful when modelling trajectories over a longer timescale as less individual computations need to be done for the same overall time-frame. This is quantified: &lt;br /&gt;
&amp;lt;center&amp;gt; &#039;&#039;&#039;t𝛕 = nΔt and t&amp;lt;sub&amp;gt;CPU&amp;lt;/sub&amp;gt; = nΔt&amp;lt;sub&amp;gt;CPU &amp;lt;/sub&amp;gt; and the computational expense ∝N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; with time-step&#039;&#039;&#039;&amp;lt;/center&amp;gt;From figure 14 is can be seen that the time-step 0.015 is a particularly bad choice for the MD simulation as the system never equilibriates and deviates increasingly with time from the standard values obtained with the shorter time-steps. This is because the system is unstable because it permits devastating atomic collisions as the large Δt propagates relative atomic positions where r&amp;lt;sub&amp;gt;AB&amp;lt;/sub&amp;gt;&amp;lt;σ. This interaction as stated previously generates a severe repulsive force propelling atoms apart and raising the system energy. Over time the occurrence of these interactions continues, explaining the increasingly large deviations. The time-steps 0.01 and 0.0075 do allow the system to equilibriate, but crucially the total energy values this occurs at is larger than that for the remaining two smaller time-steps simulated and therefore do not yield an accurate simulations of the system. As seen before, smaller time-steps lead to more accurate trajectory simulations, reaching a  Lennard-Jones potential minima as seen when comparing 0.2 and 0.1, as such these time-steps are also not reliable. The time-steps 0.0025 and 0.0001 both equilibriate at the lowest total energy value, however when taking into account computational efficiency it is found that a time-step of 0.0025 is most useful for subsequent MD simulations.  &amp;lt;gallery mode=packed heights=300px&amp;gt;&lt;br /&gt;
File:alltimestepcomparisonetotpsrw.PNG|figure 14;Totat energy vs. time, for all timesteps&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations under Specific Conditions ==&lt;br /&gt;
Simulations in this section are run in the isobaric ensemble [N, P, T]. Initial atomic positions are as before where a pseudo-crystal is melted to generate equilibrium-like conditions.&lt;br /&gt;
&lt;br /&gt;
=== Task 1- Conditions to simulate a LJ fluid ===&lt;br /&gt;
The critical temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 is defined as the temperature above which no value of pressure can cause liquidation and as such the LJ fluid will always be supercritical above this tempeature. Because of this as long as the temperature modelled is greater than equal to T&amp;lt;sup&amp;gt;* &amp;lt;/sup&amp;gt;, the pressure can be chosen freely. A supercritical fluid is modelled using MD as this is easier to compute as opposed to when the system is in two phases; vapour and liquid which occurs below the critical temperature.&lt;br /&gt;
* The temperature chosen are: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 5,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6&lt;br /&gt;
* The pressures chosen are: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 10&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous section&lt;br /&gt;
&lt;br /&gt;
=== Task 2- Simple correction factors ===&lt;br /&gt;
&lt;br /&gt;
==== Controlling the temperature ====&lt;br /&gt;
The equiparition theorem derived from statistical mechanics tells us that each translational DoF of the system contributes &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; to the total internal energy of the system at equilibrium. Therefore for a total system consisting of N atoms the following equation holds: &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because MD simulation temperatures fluctuate the total kinetic energy of the system and analogously the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; can at different time-steps be either larger or smaller than the specified temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; chosen to simulate at. A correction factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be introduced to correct this, which is inputted by via multiplication by the velocity.&lt;br /&gt;
&lt;br /&gt;
Two simulataneous equations for the temperature in terms sum of the kinetic energies of individual particles results;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1) \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2) \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve these and find gamma at a specified &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; take the LHS of equation 2 and divide by the LHS of equation 1. All terms cancel expect the constant gamma for each individual particle revealing:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\gamma^{2}} = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Therefore by rearrangement&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controlling the pressure ====&lt;br /&gt;
At each time-step, if the pressure of the system is too large the simulation box volume/size is increased and vice-versa when the pressure is too low. This is permitted as in the isobaric ensemble the system volume does not have to remain constant.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The input script ===&lt;br /&gt;
The LAMMPS manual is used to better understand the following important command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;The command &#039;&#039;&#039;&#039;fix_aves&#039;&#039;&#039;&#039; allows LAMMPS to calculate a thermodynamics properties average value over a simulation dependent on the numbers that follow&lt;br /&gt;
&lt;br /&gt;
General syntax: &#039;fix ID group-ID ave/time N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt; value1 value 2....&#039;&lt;br /&gt;
* 100 = N&amp;lt;sub&amp;gt;every: &amp;lt;/sub&amp;gt;specifies the use of input values every 100 timesteps&lt;br /&gt;
* 1000 = N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt;: specifies the use of input values 1000 times before calculating averages&lt;br /&gt;
* 10000 = N&amp;lt;sub&amp;gt;freq&amp;lt;/sub&amp;gt;: specifies LAMMPS to calculate averages every 10000 time-steps&lt;br /&gt;
* value1/2/3: specifies which thermodynamic properties are to be averaged&lt;br /&gt;
&lt;br /&gt;
=== Task 4- MD simulation of density vs. The Equation of State ===&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The plots in figures 15 (pressure = 1) and 16 (pressure = 10) both demonstrate that the simulated densities are systematically lower than those predicted by the ideal gas law. Furthermore error bars are plotted on both the x and y axes, however these are small and hard to see, demonstrating the small standard deviations in the simulated values of density. It should be noted that densities calculated using the equation of state use K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; in reduced units, i.e unity.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=330px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw20.PNG|figure 15;Density vs. temperature, pressure = 1.0&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=350px&amp;gt;&lt;br /&gt;
File:mdvsiglp1psrw2.PNG|figure 16;Density vs. temperature, pressure = 10&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To discuss the deviations seen in the above plots an understanding of the ideal gas law, its assumptions and when these are met by a system is required. An ideal gas assumption of a system is most appropriate when the system is both dilute and contains inert particles i.e ones that do not interact and are invisible to one-another. For example a dilute inert gas sample would be an ideal case. In these systems the total internal energy is wholly contributed to by individual particles kinetic energy, and the potential energy of the system is zero. In contrast the simulations utilize pairwise Lennard-Jones potentials and as such the PE contribution to the systems internal energy is non-zero. As a result both attractive and repulsive PE terms must be considered meaning the closeness of atoms inter-nuclear distances are limited by these factors, this is not the case for an ideal has.&lt;br /&gt;
&lt;br /&gt;
For both pressure; 1.0 and 10, the deviation from the equation of state decreases with temperature, this can be understood by considering that each individual particles kinetic energy increases, given by the Maxwell-Boltzmann distribution and the equipartition principle. The systems behavior therefore tends toward that of an ideal gas system as the KE becomes dominant over the PE, given by pair-wise LJ potentials repulsive terms. Overall increased thermal motion causes both systems densities to decrease and a convergence seems to be occurring for the calculated values of system density.&lt;br /&gt;
&lt;br /&gt;
It is seen that densities calculated using simulations at higher pressure deviate to a greater extent from the equation of state. This is because atoms are forced closer together on average increasing the overall potential energy of the system due to increased repulsive interactions causing the PE contribution of the system to dominate. As discussed before this is non-ideal behavior. In contrast atoms in an ideal gas system are easily pushed closer together due to a total lack of potential interactions meaning deviation in the density is far higher in the p=10 case than p=1 case.&lt;br /&gt;
&lt;br /&gt;
== Calculating the Heat Capacity using Statistical Physics ==&lt;br /&gt;
Heat capacity as described by statistical mechanics is different from other thermodynamic properties in that it is not an ensemble average but a measure of fluctuations about a systems internal energy equilibirum value. If one can determine the size of these fluctuations, of which are Gaussian with a standard deviation: &amp;lt;math&amp;gt; \sigma\tilde=\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt; then the heat capacity can be calculated.&lt;br /&gt;
&lt;br /&gt;
The definition of the heat capacity at constant volume in the [N, V, T] ensemble is as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The &amp;lt;math&amp;gt;N^{2}&amp;lt;/math&amp;gt; term is introduced in this definition as a correction factor due to the way LAMMPS calculates the heat capacity. The now calculated value will be extensive as it should be.&lt;br /&gt;
* The following two plots show the specific heat capacity per volume vs. temperature, once again the conditions (temperature and densities) chosen correspond to a Lennard-Jones super-critical fluid.&lt;br /&gt;
* The temperatures chosen: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2,  T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.2,  T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.4,  T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 2.6,  T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 2.8&lt;br /&gt;
* The densities chosen: ρ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.2 and ρ&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.8&lt;br /&gt;
* The time-step chosen: Δt = 0.0025 for the reason specified in the previous sections&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:heatcapacitypsrw2.PNG|figure 17; Heat capacity per unit volume vs. temperature. Density:0.2 and 0.8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;To discuss the trends shown it must be known simply that the heat capacity is also a measure of how easy a systems atoms are to excite thermally. Furthermore it is also defined as the amount of energy needed to raise the temperature of a system by one degree. Generally this means that heat capacity increases with temperature. However it is found that for supercritical Lennard-Jones fluids a decreasing linear trend&amp;lt;ref&amp;gt;Fluid Phase Equilibria 119(1996), p6, fig1.&amp;lt;/ref&amp;gt;, and a maxima&amp;lt;ref&amp;gt;J. Chem. Phys., Vol. 107, No. 6, 8 August 1997, p2029&amp;lt;/ref&amp;gt; are expected in the heat capacity of the system, the second of which occurs at the critical temperature itself. This trend is seen at both densities. The difference between densities of 0.2 and 0.8 is as expected for an extensive property like heat capacity as a higher density requires a smaller volume and as such there are a greater number of particles per volume which is why the plot for  ρ = 0.8 is systematically higher but follows the same trend as at  ρ = 0.2.&lt;br /&gt;
&lt;br /&gt;
The linear decrease is hard to explain but is plausible a supercritical LJ-fluids energy level structure is analgous to that of the hydrogen atom in that the energy spacing between levels decreases as the energy of the states increase. Because of this the density of these electronic states increases. Remembering that the MD simulations are done in the classical regime in a temperature range of 240-360K. Therefore all the DoF of the system are all accessible, unlike for a H-atom, and the energy levels form a continuum band structure. To conclude as the the thermal energy available to the system increases higher energy states are accessible. As the density of states is greater at these energies the promotion energy needed to enter an unpopulated state and distribute this population in a thermal equilibrium is reduced and hence so is the heat capacity.&lt;br /&gt;
&lt;br /&gt;
The temperature range modelled is shown in the graph below the same behaviour of the heat capacity is observed after the phase-transition to a LJ supercritical fluid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=450px&amp;gt;&lt;br /&gt;
File:crithcpsrw.PNG|figure 18; Lennard-Jones fluid critical heat capacity trend and maximum point[2]&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The input script used in LAMMPS is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&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;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveenergy equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heat_capacity equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;heat_capacity ${heat_capacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the Radial Distribution function ==&lt;br /&gt;
The radial distribution is an important statistical mechanical function as it captures the structure of liquids and amorphous solids. It is given by &#039;&#039;&#039;ρg(r)&#039;&#039;&#039; which yields the time-averaged radial density of particles at r with respect to a tagged particle at the origin. In this section the RDF of a Lennard-Jones vapour, liquid and solid is computed. Doing so requires system conditions that yield such phases, these are determined from a LJ phase diagram, avoiding the liquid-vapour coexistence and supercritical fluid regions.&amp;lt;ref&amp;gt;Jean-Pierre Hansen and Loup Verlet.Phys. Rev. 184, 151 – Published 5 August 1969, p2029&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Vapour: ρ = 0.05, T = 1.2&lt;br /&gt;
* Liquid: ρ = 0.8, T = 1.3&lt;br /&gt;
* Solid: ρ = 1.2, T = 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:allljphasespsrw.PNG|figure 20; RDF for all LJ phases vs. time, Δt=0.002 (pre-set)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is key to note that all three phases only have a non-zero RDF at interatomic distances &amp;gt;0.9. Below this value corresponds to an excluded volume overlap and as such is highly unlikely to be occupied by a nieghbouring atom due to the very-strong LJ repulsive term, ∝r&amp;lt;sup&amp;gt;-12,&amp;lt;/sup&amp;gt;. Furthermore the time-step used &amp;lt;0.01 means that this phenomena will never occur. In addition, in all phases the RDF tends to/fluctuate about unity at large radial distances this is because particle distribution is totally uncorrelated as the LJ pair-wise potential tends to zero. There is no long-range structure present such that ρg(r) =1, which is simply the number of molecules per unit volume. Note that this value is normalized from 1.2 to 1.0. Each phase contains at least one peak in its RDF, the first of which are at very similar radial distances.&lt;br /&gt;
&lt;br /&gt;
The liquid phase RDF contains three alternating peaks. The first and largest occurs at r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; in the LJ potential minimum and nearest neighbours take advantage of this local PE well. The second peak occurs at a large radial distance and is a result of the nearest neighbouring atoms exclusion zone. These peaks alternate outwards resembling an expanding shell system of atomic packing. These peaks loose correlation with respect to the reference atom at the origin due to random thermal pertubations, which accumulate as the shells expand outward. The RDF has only 3 distinct peaks leading to the expected conclusion that the liquid phase has only short-range order up until an internuclear distance of approximately 4.0. It is seen that the local order is similar to that of the solid phase, but crucially this similarity decays rapidly with distance rendering a system with no-long order.&lt;br /&gt;
&lt;br /&gt;
The vapour phase RDF on the other hand contains only one peak demonstrating this phase has even shorter-range order. This is also expected as the phase is much less dense and was simulated with a density of 0.05 compared to 0.8. It is energetically favorable due to larger system disorder and therefore entropy that just one nieghbouring atom exists before a return to the normalized system bulk density as any correlation beyond this would reduce the systems free energy.&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most peaks of which occur over the entire course of the simulation. The major difference is the much sharper nature of these peaks when compared to the vapour and liquid phase RDF&#039;s. This is because the system is much more ordered, in fact the peaks refer to lattice points in an FCC lattice. To expand this picture at 0K where there is a total absence of thermal motion of atoms on their respective FCC lattice sites, the RDF would become a delta-function at exact lattice spacing&#039;s. However the peaks are not like this due to the non-zero temperature used in the simulation and hence decrease in amplitude due to Brownian motion similar to that discussed in the liquid phase. This effect is not as severe over the simulated radial distance due to the solids higher rigidity. However it is still possible to determine the lattice spacing&#039;s using the first three peaks in the solid RDF. Furthermore using the integral of the RDF as a function of radial distance yields the areas under each of these peaks. The magnitude of this area is equivalent to the number of atoms at that radial distance and therefore yields coordination numbers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=250px&amp;gt;&lt;br /&gt;
File:rdffccpsrw.PNG|figure 21;Visualizing fcc lattice spacing&#039;s with reference to RDF peaks &lt;br /&gt;
File:solidrdfpsrw.PNG|figure 22;Solid phase LJ- first three peaks&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:solid3peakanalysispsrw.PNG|figure 23;RDF integral vs. radial extension cf. coordination numbers &lt;br /&gt;
File:solidgr first peak coordinationpsrw.PNG|figure 24;FCC nearest-nieghbour coordination &lt;br /&gt;
File:solidgr second peak coordinationpsrw.PNG|figure 25;FCC second nearest-nieghbour coordination &lt;br /&gt;
File:solidgr third peak coordinationpsrw.PNG|figure 26;FCC third nearest-nieghbour coordination &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
*It is therefore easy to see from the correspondence between figures 21 and 22 that the lattice spacing is equal to the radial distance from the RDF origin to the second peak: = 1.475&lt;br /&gt;
*From figure 23 the isolated area corresponding to each peak in figure 22 is calculated and yields coordination numbers:&lt;br /&gt;
# peak a) coordination number = 12-0 = 12- corresponds to figure 24 arrangement&lt;br /&gt;
# peak b) coordination number = 18-12 = 6- corresponds to figure 25 arrangement&lt;br /&gt;
# peak c) coordination number = 42-18 = 24- corresponds to figure 26 arrangement&lt;br /&gt;
&lt;br /&gt;
To conclude the RDF in essence measures the effect Brownian motion due to the systems thermal energy has on the local and long range order of that system. Less dense phases such as the vapour phase have fewer pair-wise potential interactions, the sum of these determines an overall energy scale for the system. For the vapour phase as compared to the condensed phases this energy scale is of a lower relative magnitude compared to the thermal energy of the system. This means random thermal perturbations of the system have a larger effect. This leads to reduced long-range order and a faster return to bulk density RDF.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1- The Mean Squared Displacement (MSD) ===&lt;br /&gt;
The MSD of a system is a measure of the deviation of a particle with reference to its own time-averaged position. More specifically this deviation can be defined as the extent of spatial random motion explored by a random walker due to its Brownian motion due its inherent thermodynamic driving force to increase the systems overall entropy, and reduce its overall free energy. The result of such motion in systems is diffusion. The probability of finding a particle based of this motion with respect to its starting position can be described by a Gaussian distribution and hence the most likely position for it to be is it starting position. However the significance of the tails of such a distribution depend of the medium/phase the particle is in. Three regimes can occur depending on this which encapsulate the effect of different diffusive resistances, which are in fact the frequency of collisions with other particles in the system. These regimes can be quantified and visualized using the MSD plotted against values of the time-averaged timestep.&lt;br /&gt;
&lt;br /&gt;
*Quadratic regime- A line curving upward with a quadratic relation to the time-step. Only pure diffusion of the particle is occurring i.e the trajectory of the particle is ballistic in nature. As a result each particles velocity is constant and therefore the distance travelled per time-step is also. The MSD is defined by the square of the variance, therefore in this regime MSD∝t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. &lt;br /&gt;
*Linear regime- A completely straight line. This occurs when the particles trajectory is determined by Brownian motion as the frequency of collisions play an important role in the overall averaged deviation. This generally occurs in denser phases and to represent this MSD∝t.&lt;br /&gt;
*Plateau regime- MSD line plateaus as the time of simulation increases. This occurs when the particles motion is confined.&lt;br /&gt;
&lt;br /&gt;
The MSD uses only one input data-set; the time-evolution of the particle- its trajectory and is defined by the following formula:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\rm MSD}\equiv\langle (x-x_0)^2\rangle=\frac{1}{T}\sum_{t=1}^T (x(\delta_t) - x_0)^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
This formula shows the averaged difference between to positions of a particle along the trajectory, separated by the simulation time-interval over the total simulation time frame T. Each of these averages is squared and the result is a description of the positional variance.&lt;br /&gt;
&lt;br /&gt;
The MSD yields information regarding how far a particle deviates from its starting position in the simulation time-frame, the diffusivity constant of the system and what environment the particle is in.&lt;br /&gt;
&lt;br /&gt;
The following plots show the MSD vs. Time-Averaged Timestep for the vapour, liquid and solid Lennard-Jones phases for both small system MD calculations conducted for this report (same conditions and timestep as before) and for a much larger system containing one-million atoms.&lt;br /&gt;
*Vapour MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=200px&amp;gt;&lt;br /&gt;
File:LJvapourmsdpsrw.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw.PNG&lt;br /&gt;
File:LJvapourmsdpsrw1m.PNG&lt;br /&gt;
File:linearegimevapourmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Two plots for both the small and large systems are shown. This is because the LJ vapour phase contains both a distinct quadratic regime and linear regime, the linear regime is needed to calculate the diffusion coefficient of the system. This system is the least dense of all those modelled and because of this until the 2000th timestep each particle does not encounter and collide a sufficient amount meaning trajectories are dominated by ballistic behaviour. However a transition to a linear regime occurs after this point because of attractive pair-wise Lennard-Jones potentials bringing particles closer together on average making collisions more frequent and Brownian behaviour starts to dominate. This transition can be quantified by the overall increase in R^{2} values, a statistical measure of linearity, from the entire simulation to that isolated after the 2000th timestep: 0.9869 to 0.9996 (small sim) and 0.9819 to 0.999 (1m sim).&lt;br /&gt;
*Liquid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJliquidmsdpsrw.PNG&lt;br /&gt;
File:LJliquidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In contrast to the vapour phase MSD, the MSD for the liquid phase is entirely in the linear regime. This is expected due to the denser nature of the phase resulting in a far higher initial frequency of particle collisions and hence Brownian motion. This is quantified by the greater R^2 value over the entire simulation: 0.999. This does show the convergence of the vapour and liquid phase positional deviations at larger time-scales.&lt;br /&gt;
*Solid MSD&lt;br /&gt;
&amp;lt;gallery mode=packed heights=280px&amp;gt;&lt;br /&gt;
File:LJsolidmsdpsrw.PNG&lt;br /&gt;
File:LJsolidmsdpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The solid phase MSD shows the biggest contrast in behaviour between all phases. The system is frozen and the MSD plateaus because kinetic energy pf the system is not sufficient enough to reach diffusive behavior. This plateau represents a finite MSD value inherent due to the solid LJ phases FCC-crystalline structure; atoms are held rigidly on unit cell lattice sites by very strong bonds, the energy scale of such a system far exceeds that of the systems thermal energy. As a result these atoms are confined to a limited radial distance from their respective lattice sites. This behaviour is quantified by the plots as the plateau value of the solid phase is far lower in magnitude, 0.0198, compared to the growing MSD values seen for the less dense phases. In addition the plots show a sharp spike up until the 87th time-step denoting the confined region atoms in the solid phase can explore. The extent of confinement of the particle is calculated by square-rooting the MSD plateau value as this will be characteristic of the confinement diameter in a Lennard-Jones FCC lattice - 0.128 (small sim) and 0.147 (1m sim), in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Task 2- The Diffusion Coefficient (D) ===&lt;br /&gt;
The extent of the LJ systems diffusive behaviour in each of the phases can be contained in a single diffusive coefficient. This can be determined from the linear gradient of the MSD plots in the previous section because of its definition in 3D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The value of the diffusion coefficient was calculated for each phase for both the smaller D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and larger D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; simulations by exploiting this relation with the MSD. For this calculation which ultilises the gradient of the MSD vs Timestep(t/Δt) plot and therefore values directly obtained will be in reduced units. These values still have the dimensionality commonly used for D, [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;[T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, but this needs to be converted into per unit time, not timestep, to yield the common S.I units [m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;]. This is achieved by dividing all output values by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/6 * (0.0469/0.0025) = 3.127&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 2.413&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.093, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.068&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 3.333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 3.333x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the MSD plots and diffusive behaviour of a less dense state, the diffusion coefficient for the vapour phase is far larger than either of the condensed phases. This is due to a lower collision frequency encountered along particle trajectories. Furthermore there is another striking decrease in values calculated when comparing the liquid and solid phases. As stated before this is because diffusive behaviour is essentially non-existent in the solid phase due to extremely high rigidity due to particles being fixed on their respective lattice sites.&lt;br /&gt;
&lt;br /&gt;
Note that increasing the number of atoms simulated still leads to the same behaviour being simulated and identified in the phases. The only notable change is in the Gaussian nature of the MSD where there is a reduction in fluctuations in the solid state MSD due to a larger system size being simulated. This is quantified by the fact that a Gaussians FWHM can be calculated by the square root of the product of the diffusion coefficient and the total simulation time. The total simulation time for both sets of simulations was fixed at 5000 time-averaged time-steps therefore because the D-value calculated for the solid phase using one-million atoms is an order of magnitude larger the FWHM is reduced, and therefore the standard deviation/flucuations of the results is too.&lt;br /&gt;
&lt;br /&gt;
=== Task 3- The Velocity Autocorrelation Function (VACF) ===&lt;br /&gt;
Autocorrelation functions are used in MD to determine time-dependent properties of atomic systems. The VACF does this by measuring the correlation of an atoms velocity after a certain number of time-steps with its own velocity at a previous time, in this report this is its initial equilibrium velocity as described by the Maxwell-Boltzmann relation. This is useful as it provides insight into the role inter-atomic forces, due to the Lennard-Jones potential, have on an atoms motion in time. It is defined mathematically as the following:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1D harmonic oscillator solution to the normalized VACF ====&lt;br /&gt;
The normalized VACF is given by the following equation:&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remembering the equation describing the 1D harmonic oscillators time-evolving position:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the velocity for the system is given by the derivative:&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squaring this yields:&lt;br /&gt;
&amp;lt;math&amp;gt;v^{2}(t)=\frac{dx}{dt}=A^{2}\omega^{2} sin(\omega t+\phi)^{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Incorporating the timestep &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; into the equation allows us to write out the normalized VACF as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2} sin(\omega t+\phi)^{2}dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Amplitude and angular frequency terms outside the trigonometric functions cancel and we re-write the equation using the double angle formula for the sine terms in the numerator. It is key to couple the correct terms such that &amp;lt;math&amp;gt;sin(A+B) = sin((\omega t+\phi)+\omega \tau)&amp;lt;/math&amp;gt; terms. This transformation and separating the numerator functions yields the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is apparent why the couple of the correct terms was key. Because we are integrating with respect to time the isolated function &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant. It can therefore be removed from the second integral. This essential as it transforms the second improper integral such that it is now equal to unity. This is because the numerator and denominator integrands and limits are identical. Utilising the double angle formula for sin(2A) yields the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+ sin(\omega\tau)\frac{1}{2}\times\frac{\int_{-\infty}^{\infty}(sin(\omega\tau)sin(2\omega t +2\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now identifying the remaining numerator integrand as the product of two sine functions, and is therefore an odd function, integrating this between positive and negative values of the same arbitary limit, even if infinity, yields zero. Furthermore the denominator integrand is squared and as such can only take positive values. Integrating this between the limits of infinity yields infinity. In addition this could be showed by expanded using the double angle formula for cos(2A). In both cases an even function results. As a result the final fraction is equivalent to zero divided by infinity, therefore the second term equal zero.&lt;br /&gt;
&lt;br /&gt;
This leaves the only remaining term &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; which is equal to &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; and is therefore the 1D harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
==== Determining the Diffusion Coefficient using the VACF &amp;amp; Comparison 1D harmonic oscillator VACF with LJ liquid and solid ====&lt;br /&gt;
It is possible to use the VACF of a system as an alternative method to the MSD for calculating its diffusion coefficient. This is achieved by integrating the VACF over the simulation time frame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plots are again from MD simulations of a small system and of a larger system consisting of one-million atoms, however they are now plots of the running VACF integral vs. time-step. This was achieved by applying the trapezium rule to output data from LAMMPS and is useful as the diffusion coefficient can be calculated from the final summation.&lt;br /&gt;
&lt;br /&gt;
*Vapour&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfvapourpsrw.PNG&lt;br /&gt;
File:LJvacfvapourpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Liquid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfliquidpsrw.PNG&lt;br /&gt;
File:LJvacfliquidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Solid&lt;br /&gt;
&amp;lt;gallery mode=packed heights=260px&amp;gt;&lt;br /&gt;
File:LJvacfsolidpsrw.PNG&lt;br /&gt;
File:LJvacfsolidpsrw1m.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values of the diffusion coefficient are calculated using final integral summation values seen on all plots. As before D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;1m&amp;lt;/sub&amp;gt; denote values for the small and large atom number simulations. As for the MSD method for calculating D, the immediate values outputed are once again in reduced units. In contrast to the MSD calculation, the VACF method used the integral of a plot, VACF vs. Timestep and therefore the dimensionality of the D values is now [L]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;([T]&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;/Δt) and therefore to obtain S.I units for D values, these outputs must be multiplied by the timestep, 0.0025.&lt;br /&gt;
* Vapour: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;1/3 * 4024.971086 * 0.0025  = 3.354&#039;&#039;&#039;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 4.086&lt;br /&gt;
* Liquid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 0.097, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 0.170&lt;br /&gt;
* Solid: D&amp;lt;sub&amp;gt;Small&amp;lt;/sub&amp;gt;  = 1.554x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;, D&amp;lt;sub&amp;gt;1M&amp;lt;/sub&amp;gt; = 5.69x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values follow the decreasing trend observed for the diffusion coefficients calculated using the MSD for each phase. The vapour system giving the largest value of D and the solid system having the smallest. Once again, the simulation using one-million atoms doesn&#039;t have any significant effect on the values on the magnitude of values for diffusion coefficients obtained. However it must be noted that a negative result was obtained for the solid D(small sim), using the VACF method. A negative diffusion coefficient would result from this value, which makes no physical sense. This error is due to the way the VACF is calculated as the sum of averaged product velocity at a time-origin and at a time, tau, later. At the end of the simulation the values of tau increase meaning the calculation can average over progressively fewer time-origins. For example: tau=3000, the calculation can use time origins at 0, 1, 2....3000, but for tau=6000 the calculation only has the time-origin at 0 available. To conclude the calculation of the VACF becomes more error prone at larger tau values. This error propagates into the integral VACF vs. timestep plots and results in the negative value in the case of the solid LJ phase. However this error is small it is seen that the integral does tend to zero as expected and the resulting D value is close to zero.&lt;br /&gt;
&lt;br /&gt;
In terms of error, it is evident it was not too large as the discrepancies between the MSD and VACF method values of the calculated the diffusion coefficient are small. The most significant source of error can be assigned to the use of the trapezium rule for approximating the area under the VACF curves used to plot the running integrals and subsequently D. This method due to the geometry of a trapeziod always over-estimates the integral as the majority of the integrand in all cases are concave-up. This would not be the case if used for the periodic VACF of the 1D harmonic oscillator as both the concave-up over-estimations and concave-down under-estimations cancel when summed. To reduce this error a larger number of smaller trapezium can be used, however this is computationally expensive. Other methods of numerical integration of which have more accuracy for Gaussian distributed functions such as Gaussian quadrature could be used. &lt;br /&gt;
&lt;br /&gt;
Furthermore the theory underlying the relationship between the VACF area and the diffusion coefficient only holds when the integral VACF of the system decays to zero in the simulation time. For the solid system, the assumption that this condition is met is arguable and therefore error will be introduced into the D value calculated for this system and could also have been the cause of the negative D obtained for the solid LJ phase. Evidence for this can be drawn from the discrepancies in D-values calculated for the different LJ phases for the small and large atom count simulations. Furthermore the way the VACF is orginally calculated leads to increasing errors as the simulation progresses and could also be a cause of the negative D value for the solid LJ phase. A clear anomaly can be seen between the MD calculations conducted for this report and the larger simulations only for the solid phase. The one-million atom system where the VACF did decay to zero with a high degree of accuracy calculated a D value of at least entire order of magnitude larger. This lack of convergence also manifested itself in a large difference in the MSD calculations of D. Finally, absolute error could be reduced by simply simulating more precise particle trajectories, however this would require a smaller timestep and therefore would also be more computationally expensive due to reasons discussed previously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Referring back to the definition of the VACF it is seen that it utilises a summation of the scalar product of a velocity after a certain number of timesteps and an initial starting velocity for all atoms in a system. Because all systems modelled are entirely classical, Newton&#039;s laws state that for an atom with a specific velocity that undegoes no collisions (i.e it is isolated) will retain this velocity for the simulation/all time and the VACF would be a horizontal line equal to one (normalized). However a system where inter-atomic forces are weak, but not negligible, Newton&#039;s same laws state the magnitude and/or direction of a particles velocity will change gradually. In other words the systems overall velocity will decorrelate in time but only due to diffusive behaviour, this is seen for non-dense systems such as the LJ vapour pahse where this decay in correlation is exponential in form, this is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=380px&amp;gt;&lt;br /&gt;
File:liquidvacfpsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following plot displays the VACF&#039;s for the 1D harmonic oscillator found in the previous section on the same axes as the solid and liquid LJ VACF&#039;s. This is plotted for timesteps between 0 and 500.&lt;br /&gt;
&amp;lt;gallery mode=packed heights=320px&amp;gt;&lt;br /&gt;
File:LJvacfallphasespsrw.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[Note that initial values of the solid and liquid LJ VACF&#039;s are not normalized and should be equal to one for obvious reasons.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator simulated was a single isolated oscillator it therefore never collides with other particles and as such its time-evolving velocity never de-synchronizes. As stated before, the VACF is defined vectorially in such a way that for a single oscillator the dot product of velocities at different time-steps equal negative one when a particle is traveling with the same speed but in the opposite direction and vice-versa for a value of one. Additionally the value of zero corresponds to the harmonic oscillator in a state with maximum potential energy and therefore no kinetic energy. This behaviour is periodic as correlation is over time is never lost due to a total absence of collisions and explains the harmonic oscillator solution to the normalized VACF.&lt;br /&gt;
&lt;br /&gt;
Contrary to the discussion for the non-dense LJ vapour phase, atoms in denser phases such as the solid and liquid phases encounter far stronger inter-atomic forces. Atoms in these systems observe significant order as discussed in the RDF section this is because atoms seek out internuclear distance arrangements in the LJ potential minima and away from excluded volumes for energetic stability.  In solids strong internuclear forces cause these ordered locations to become very stable resulting in a lattice structure, and the atoms cannot escape easily from their lattice points.&lt;br /&gt;
&lt;br /&gt;
Atomic motion in a solid LJ VACF should therefore appear similar as each atom&#039;s motion - vibrating and relaxing about its lattice point can be modelled as a simple harmonic oscillator, this is seen as the VACF function function oscillates strongly from positive to negative values. This is a reasonable assumption because as just discussed the atoms are confined to vibrate in a small radius about their lattice points and affords for an easy comparison to the isolated harmonic oscillators behaviour. However a large difference occurs in these two systems VACF&#039;s because the VACF is an average over all of these small oscillators and because each is not isolated collisions occur that disrupt the perfect oscillatory motions. De-synchronization therefore starts to dominate due to these pertubative collisions after 50 timesteps causing the overall distribution of velocities to become randomized. This results in a VACF resembling damped harmonic motion and hence there is a total VACF of zero after a finite period of time. It should be noted that before this correlation similar to the harmonic oscillator was observed as a single distinct peak at 38 timesteps. To conclude the LJ solid VACT depicts a system that behaves more like a point as compared to the isolated harmonic oscillator after the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
Both the solid and liquid VACF&#039;s observe this behaviour as the liquid also showed fleeting oscillatory behaviour, manifesting itself in a single peak occurring at around 65 timesteps. Recalling findings from the RDF&#039;s of both the solid and liquid states; a liquids local order is very similar to that of a solid as similar RDF peaks occured due to a local atomic shell system. However the liquid RDF decayed very quickly as a the liquid observed no long-range order due to a lower density and weaker interatomic interactions on average. This single peak can be understood as in this phase atoms do not have fixed regular &amp;quot;lattice&amp;quot; positions. Refering back to the magnitude of diffusion coefficients calculated for the liquid and solid LJ phases, the liquid phase D-value are at least five orders of magnitude greater than for the solid phase for both the MSD and VACF methods. Therefore diffusive motion of the system contributes far more to the rapidly decaying  oscillatory motion seen in the liquid VACF. The single peak can be described as one very damped oscillation before complete de-correlation occurs, this may be considered a collision between two atoms before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Using a simple Lennard Jones pair-wise potential system, this report has demonstrated the stark differences in structure and behaviour of the solid, liquid and vapour phases. This is summarised particularly well in &#039;Soft Condensed Matter, R.A. Jones, Oxford 2002.&#039;&amp;lt;ref&amp;gt;Soft Condensed Matter, R.A. Jones, Oxford 2002, p9&amp;lt;/ref&amp;gt; where Jones makes clear the relative effects different levels of thermal perturbation have on the physical state of a system. I will use his concise summary alongside computational evidence found throughout this report to explain these differences more roundly.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase at high temperatures molecules are in a state of constant motion where the attractive forces, dictated by the LJ potential in this report, are weak compared to the thermal energy. These molecules infrequently collide such that there is very little correlation between the motions of individuals. This was evidenced in the VACF, dictated purely by diffusion and a ballistic trajectory and was seen as short time scales of the simulation. In this state the system approximates fairly well with the familiar ideal gas, seen in the convergence of the simulated systems densities with the equation of state as the temperature was increased in section 3.4. As the temperature is reduced, attractive interactions that occur during collisions start to become more significant. The relative motions between individuals particles start to become correlated and the system tends to more dense state where collisions are frequent,  which is characterised by the vapour VACF transition to the linear regime. The total system energy is still kinetically dominated, however the energies of interactions in the transient clusters start to become significant and we head towards a phase transition. This transition occurs when these correlations become permanent and substantial short-range order starts to occur, characteristic of the denser liquid phase.&lt;br /&gt;
&lt;br /&gt;
The attractive and repulsive terms of this interactive Lennard-Jones potential both play a significant role in this new ordering. There is a balance between the tension of the attractive and repulsive terms, mathematically given by their respective r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; and r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt; power laws. The attractive term tries to pack molecules as closely as possible- as seen to be in the LJ -ε potential well - and the repulsive term which imposed a minimum separation characteristic of an exclusion volume. This ordering was seen in the RDF plots of the liquid phase where oscillating probability densities for nieghbouring particles was seen to be at finite radial distances characterised by a short-range atomic shell system producing only one distinct peak. As the temperature/system perturbation decreases further it becomes favorable to pack molecules in a regular rather than random way, achieving a higher density of molecules whilst still satisfying a minimum distance constraint. Here the system has entered the solid phase and such a system was identified by its RDF to demonstrate significant long-range order characteristic of an FCC crystal lattice. The area under each curve and lattice separation was calculated yielding useful information concerning the crystal structure and coordination spheres. The VACF of these phases was compared to that of an isolated harmonic oscillator and it was still found that thermal perturbations de-synchronized molecular motion, though less rapidly, but the overall order of the system is far less perturbed, leading to the permanent ordering of particles.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544503</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544503"/>
		<updated>2016-02-27T12:05:34Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you say a bit more about this? Why won&#039;t this energy just be dissipated through the system?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Nicely explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good effort, but it&#039;s the mass of all atoms of type one, not just the mass of the first atom.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This section makes sure that the same length of time is simulated no matter what timestep is chosen.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: There should be a plot of energy as a function of time for all five timesteps, on the same axes. You should find that 0.015 does not reach equilibrium. What timestep did you choose for the rest of your simulations? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, but why do you always find a lower density in the simulations?&amp;lt;/span&amp;gt;&#039;&#039;&#039;And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. What about the trend with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The number of atoms isn&#039;t given by 15*15*15*density, it&#039;s just 15^3. You&#039;ve got the correct trend, but the absolute values are a bit out. Can you explain how this varies with density and temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Only three?&amp;lt;/span&amp;gt;&#039;&#039;&#039;If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: I think there&#039;s a little bit of confusion here - whichever reference atom you pick, the lattice looks the same in all directions. The RDF is also averaged over all atoms. I wanted you to work out the interatomic distances in terms of the lattice constant for the first three peaks, and calculate the spacing using your graph, rather than reading from the log file. You also should have used the integrated g(r) data to calculate the coordination number for each of the first three peaks.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What density did you use for the gas? As you say, it looks very similar to the liquid. I suspect this is a bit too dense, and is in the liquid/gas coexistence region. Why does the solid RDF have so many more defined peaks?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful, these values are all in reduced units.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Do you think this is a realistic MSD for a solid? Why does it look so different to the result for the 1 million atoms simulation? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should only fit the straight line to the linear region. Why do you think this graph is curved?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: How do the values of D compare across phases? Does using 1 million atoms make a difference?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is the right start.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544502</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544502"/>
		<updated>2016-02-27T12:02:35Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you say a bit more about this? Why won&#039;t this energy just be dissipated through the system?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Nicely explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good effort, but it&#039;s the mass of all atoms of type one, not just the mass of the first atom.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This section makes sure that the same length of time is simulated no matter what timestep is chosen.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: There should be a plot of energy as a function of time for all five timesteps, on the same axes. You should find that 0.015 does not reach equilibrium. What timestep did you choose for the rest of your simulations? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, but why do you always find a lower density in the simulations?&amp;lt;/span&amp;gt;&#039;&#039;&#039;And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. What about the trend with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The number of atoms isn&#039;t given by 15*15*15*density, it&#039;s just 15^3. You&#039;ve got the correct trend, but the absolute values are a bit out. Can you explain how this varies with density and temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Only three?&amp;lt;/span&amp;gt;&#039;&#039;&#039;If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: I think there&#039;s a little bit of confusion here - whichever reference atom you pick, the lattice looks the same in all directions. The RDF is also averaged over all atoms. I wanted you to work out the interatomic distances in terms of the lattice constant for the first three peaks, and calculate the spacing using your graph, rather than reading from the log file. You also should have used the integrated g(r) data to calculate the coordination number for each of the first three peaks.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What density did you use for the gas? As you say, it looks very similar to the liquid. I suspect this is a bit too dense, and is in the liquid/gas coexistence region. Why does the solid RDF have so many more defined peaks?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544501</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544501"/>
		<updated>2016-02-27T11:56:55Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you say a bit more about this? Why won&#039;t this energy just be dissipated through the system?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Nicely explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good effort, but it&#039;s the mass of all atoms of type one, not just the mass of the first atom.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This section makes sure that the same length of time is simulated no matter what timestep is chosen.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: There should be a plot of energy as a function of time for all five timesteps, on the same axes. You should find that 0.015 does not reach equilibrium. What timestep did you choose for the rest of your simulations? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, but why do you always find a lower density in the simulations?&amp;lt;/span&amp;gt;&#039;&#039;&#039;And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. What about the trend with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The number of atoms isn&#039;t given by 15*15*15*density, it&#039;s just 15^3. You&#039;ve got the correct trend, but the absolute values are a bit out. Can you explain how this varies with density and temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544500</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544500"/>
		<updated>2016-02-27T11:53:59Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you say a bit more about this? Why won&#039;t this energy just be dissipated through the system?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Nicely explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good effort, but it&#039;s the mass of all atoms of type one, not just the mass of the first atom.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This section makes sure that the same length of time is simulated no matter what timestep is chosen.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: There should be a plot of energy as a function of time for all five timesteps, on the same axes. You should find that 0.015 does not reach equilibrium. What timestep did you choose for the rest of your simulations? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, but why do you always find a lower density in the simulations?&amp;lt;/span&amp;gt;&#039;&#039;&#039;And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. What about the trend with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544499</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544499"/>
		<updated>2016-02-27T11:51:51Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you say a bit more about this? Why won&#039;t this energy just be dissipated through the system?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Nicely explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good effort, but it&#039;s the mass of all atoms of type one, not just the mass of the first atom.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This section makes sure that the same length of time is simulated no matter what timestep is chosen.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: There should be a plot of energy as a function of time for all five timesteps, on the same axes. You should find that 0.015 does not reach equilibrium. What timestep did you choose for the rest of your simulations? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544498</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544498"/>
		<updated>2016-02-27T11:31:06Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544497</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544497"/>
		<updated>2016-02-27T11:28:46Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 1.088nm&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is just in kJ, not kJ per mole.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544496</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544496"/>
		<updated>2016-02-27T11:20:56Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]] Here, it can be seen that when the time-step is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s more important to monitor the conservation of energy, this is an indicator of how well the numerical algorithm is modelling the system.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error accumulates in the way that it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with the notation, &amp;lt;math&amp;gt;F = -\frac{dU}{dr}&amp;lt;/math&amp;gt;, so this is out by a factor of -1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The potential is at a minimum, so the force is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should get a value of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; here &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544495</id>
		<title>Talk:Mod:fpp1994</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:fpp1994&amp;diff=544495"/>
		<updated>2016-02-27T09:53:01Z</updated>

		<summary type="html">&lt;p&gt;Npj12: Created page with &amp;quot;==Introduction to Molecular Dynamics==   File:IEIEIEIEIIEIEIEIE.PNG File:FrankTASK1.xls    File:Lelelelele.PNGFile:Momomom.PNG  File:FppTASK2.xls   File:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:IEIEIEIEIIEIEIEIE.PNG]]&lt;br /&gt;
[[File:FrankTASK1.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Lelelelele.PNG]][[File:Momomom.PNG]] &lt;br /&gt;
[[File:FppTASK2.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hadfdfhaha.PNG]][[File:Eroroor.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:FppTASK3.xls]]  Here, it can be seen that when the timestep is 0.2 the total energy fluctuates by 1%. It is important to model the energy of a system you are modelling because in some cases it can be used to calculate thermodynamic quantities as energy is what will dictate how things behave.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\phi\left(r\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6} = r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt; \sigma = r_0&amp;lt;/math&amp;gt; ie &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance when the potential is zero  &lt;br /&gt;
&lt;br /&gt;
*At this seperation, the force is &amp;lt;math&amp;gt; \frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{dU}{r} = 4\epsilon \left(\frac{-12\sigma^{12}}{r^{13}} + \frac{-6\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma = r = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = 24\epsilon \left(\frac{-2}{r_0} + \frac{1}{r_0}\right) = -\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The equilibrium seperation, &amp;lt;math&amp;gt;r = r_{eq}&amp;lt;/math&amp;gt; occurs at the bottom of the well, so force is at a minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{dU}{r} = 0 = 4\epsilon \left(\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2\sigma^6 = 2 r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2} = 1.122 r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{r_{eq}^{12}} - \frac{r_0^6}{r_{eq}^6}\right) &amp;lt;/math&amp;gt; and from just above &amp;lt;math&amp;gt;r_{eq} = r_0\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon\left(\frac{r_0^{12}}{2^6r_{0}^{12}} - \frac{r_0^6}{2r_0^6}\right) = 4\epsilon\left(\frac{1}{2^6} - \frac{1}{2}\right) = 1.936\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left[- \frac{\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5} \right]_{2\sigma}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The expansion of the above bracket is &amp;lt;math&amp;gt; 4\epsilon \left( \left( - \frac{\sigma^{12}}{11 \left( \infty \right)^{11}} + \frac{\sigma^6}{5 \left( \infty \right)^{5}} \right) - \left( - \frac{\sigma^{12}}{11 \left( 2\sigma \right)^{11}} + \frac{\sigma^6}{5 \left( 2\sigma \right)^{5}} \right) \right) &amp;lt;/math&amp;gt; but since &amp;lt;math&amp;gt; \frac{1}{\infty^{n}} = 0 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon = \sigma = 1 &amp;lt;/math&amp;gt; this becomes &amp;lt;math&amp;gt; 4 \left( \frac{1}{11 \left( 2 \right)^{11}} - \frac{1}{5 \left( 2 \right)^{5}} \right) = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the same expansion, but &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; as the lower limits gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The density of water is &amp;lt;math&amp;gt;1000 \mathrm{ kg\ m}^{-3}&amp;lt;/math&amp;gt; and so &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; would weigh &amp;lt;math&amp;gt;1 \mathrm{g}&amp;lt;/math&amp;gt;. The molecular mass of water is &amp;lt;math&amp;gt; 18.0 \mathrm{g mol}^{-1}&amp;lt;/math&amp;gt; and so the amount of molecules in &amp;lt;math&amp;gt;1 \mathrm{mL}&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt;1/18 \times N_{A} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;. Therefore &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules would occupy &amp;lt;math&amp;gt;\frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-18}\mathrm{mL} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, after the periodic boundary conditions have been applied?. It would be at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; r^*\sigma = r = 0.34 \times 10^{-9} \times 3.2 = 1.08\times 10^{-9} \mathrm{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120\mathrm{K}&amp;lt;/math&amp;gt; then since &amp;lt;math&amp;gt;k_B = 1.38 \times 10^{-23}&amp;lt;/math&amp;gt; the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\epsilon = 120 \times 1.38 \times 10^{-23} \times 1000 = 1.66 \times 10^{-18} \mathrm{kJmol^{-1}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; T = \frac{T^{*}\epsilon}{k_B} = 1.5 \times 120 = 180 \mathrm{K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; Giving atoms random starting positions in simulations can cause problems because if there are two atoms that are placed too close together (ie if they are within &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; of each other) then their potential energies - and thus initial accelerations and velocities -will be extremely high and they will move through the sample with an unrealistically high speed and this will also disrupt other atoms.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If each the spacing lattice point is 1.07722 and the lattice is three dimensional then the number density of lattice point is given by &amp;lt;math&amp;gt; \frac{1}{spacing} = \frac{1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice has a number density of 1.2 then because it has four atoms per cell its volume can be given by &amp;lt;math&amp;gt; V = \frac{number}{density} = \frac{4}{1.2} &amp;lt;/math&amp;gt; and so the side length is just the cube root of this and so &amp;lt;math&amp;gt; l = \sqrt[3]{\frac{4}{1.2}} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
In the same lattice if the command &amp;quot;create_atoms&amp;quot; was used, 4000 atoms would be created as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039; &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;
The first command sets the relative mass of Atom 1 as 1.&lt;br /&gt;
&lt;br /&gt;
In the second command &amp;quot;pair_style&amp;quot; is used to describe interactions between two particles and the &amp;quot;lj/cut&amp;quot; part tells LAMMPS that this interaction follows the Lennard-Jones potential and nothing more and that it cuts of when &amp;lt;math&amp;gt; r = 3 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; tells LAMMPS what coefficients to use in the style defined above. In this case it is the Lennard-Jones potential, and so it is telling LAMMPS to set &amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; as 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5&#039;&#039;&#039; Specifying velocity and position as starting conditions means the Velocity Verlet Algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying variables rather than numerical values useful is because you may need to use that value at various points throughout the script. Using numerical values all over the script would become particularly annoying if you were running lots of simulations with the same variable multiple times as you would have to look through the whole script to find each value but with the dollar command you can just change it once. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 7&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ALL3GRAPH1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The system reaches equilibrium after a time of about 0.5&lt;br /&gt;
[[File:Total energy.PNG]]&lt;br /&gt;
&lt;br /&gt;
5 simulations were run with timestops of 0.001, 0.01, 0.0025, 0.0075, 0.015. The worst choice is the one with the highest timestop, 0.015 because ideally a balance between resolution and the amount of time the system can be monitored is preferred but all of the timestops show the eventual equilibrium and so there is little benefit to a large value as instead it does not show the fact that equilibrium had to be reached.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 1&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
10 phase points (two pressures and 5 temperatures) were selected, &amp;lt;math&amp;gt;T^* = 1.6,  1.8,  2.0,  2.2,  2.4 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; p^* = 2.4,  2.8&amp;lt;/math&amp;gt; and the timestep was 0.001&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \gamma^2 \frac{1}{2}\sum_i m_i v_i^2\ = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{T} = \frac{3}{2} N k_B &amp;lt;/math&amp;gt; therefore &amp;lt;math&amp;gt; \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{\frac{1}{2}\sum_i m_i v_i^2}{T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancel &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the LAMMPS manual&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. These commands tell LAMMPS on which timesteps to calculate the averages of the properties that follow. Nrepeat tells LAMMPS how many averages to calculate, starting from the value given by Nfreq and working back in multiples of Nevery. In this case 1000 averages are taken in total, once every 100 timesteps up to 100000 which is as far as the script will run.&lt;br /&gt;
&lt;br /&gt;
[[File:GRAPHS NPT 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The bottom two lines are the density as a function of temperature as calculated by LAMMPS whereas the top lines are calculated using the ideal gas law using the equation derived below where pressure was 2.4 and 2.8 and the temperature was the LAMMPS average. The simulated density is much lower than the one predicted by the gas law because the gas is not ideal as there are repulsive and attractive terms in the Lennard-Jones potential and ideal gases have no interaction between the particles. And as the pressure increases the gap between the simulated and calculated densities increases too because at higher pressures there are more interaction between the particles and so the ideal gas approximation gets worse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;P = \frac{N}{V}k_BT &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;   \rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt;P = \rho k_BT      &amp;lt;/math&amp;gt;     but on LAMMPS in lj style, &amp;lt;math&amp;gt; \epsilon, \sigma &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; k_B &amp;lt;/math&amp;gt; are all equal to 1&lt;br /&gt;
&lt;br /&gt;
so &amp;lt;math&amp;gt; \frac{P}{T} = \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The script used to calculate the heat capacities is below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal  0.2&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;
variable atoms equal 15*15*15*${density}&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*((f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[2]*f_aves[2]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatcap2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG]]&lt;br /&gt;
&lt;br /&gt;
The solid is face-centred cubic and so when a reference atom is defined, there are 3 different distances that the other atoms in the unit cell can be away from each other. If the reference atom is in the middle of the top face of the cube, out of the first three peaks, the smallest (and second) peak will be from the atom in the middle of the opposite face of the cell because there are 4 atoms that fit this description, also the RDF has also been normalised and this is a relationship between two of the same lattice points and so it makes sense that the density at this point would be 1. The first peak will be the atoms on the corners of the same face as the reference atom and the atoms that are in the middle of the cell’s remaining faces as they are all the same distance from the reference atom; this is because the distance as you go to an edge and go down is the same as if you go to the edge and go across since the cell is a cube, also there are 12 such atoms and this is the tallest peak. The third peak arises from the atoms that are on the corners of the opposite face of which there are 8. The numbers quoted all arise from considering the actual lattice rather than the cell and also compare well with the relative heights of the peaks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF for liquids and gases look quite similar to each other but different to that of the solid as they are much less ordered. In both cases, the first peak is quite large before the curve quickly levels out at 1. The RDF measures the amount of atoms in a shell of radius, r, around the reference atom and so when the shell is small the concentration of nearby atoms is high and they resemble clusters. However, as the shell gets bigger it starts to become more diffuse and eventually reaches a point where the concentration of atoms in the shell cannot be distinguished from the density of the system as a whole. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By eye, the liquid and gas RDFs would seem to suggest that the gas is ever so slightly denser than the liquid, however, the functions are normalised and the actual density of gases is much lower and so there are far fewer atoms than in the liquid, as can be seen in the plots of their integrations.&lt;br /&gt;
&lt;br /&gt;
[[File:Integrations.PNG]]&lt;br /&gt;
&lt;br /&gt;
From the log file, the lattice spacing of the solid is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Lattice spacing in x,y,z = 1.45447 1.45447 1.45447&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
[[File:MSDgas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 4.17 \times 10^{-4} m^2 timestep{^-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSDliq.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:MSDsolid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0025 = 1.33 \times 10^{-6} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Millison msd gas.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.0305 = 0.00508 m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd liquid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 0.001 = 1.66 \times 10^{-4} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Million msd solid.PNG]]&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{6} \times 6 \times 10^{-8} = 1 \times 10^{-8} m^2 timestep^{-1}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x&#039;\left(t\right) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v^2(t) = A^2\omega\sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;          &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right)&amp;lt;/math&amp;gt;  define: &amp;lt;math&amp;gt;\alpha = \omega t + \phi&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\alpha + \omega\tau \right) = - A\omega\sin\left(\alpha\right)\cos\left(\omega\tau\right)\sin\left(\omega\tau\right)\cos\left(\alpha\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} A^2\omega^2\sin^2\left(\alpha\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\alpha\right)\mathrm{d}\alpha}{\int_{-\infty}^{\infty}A^2\omega\sin^2\left(\alpha\right)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535429</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535429"/>
		<updated>2016-02-17T15:37:53Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not seconds! These units are reduced.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]] &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, the ideal gas has no interactions between particles &#039;&#039;at all&#039;. Can you say more about this? If you used a purely attractive potential between the particles, would you see the same thing?&amp;lt;/span&amp;gt;&#039;&#039;&#039; The discrepancy can be seen to increase with pressure, this fits with the conclusion.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Thermal energy and kinetic energy are essentially interchangeable terms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t use the Excel &amp;quot;smoothed lines&amp;quot; feature for scientific plots. Do you think the maximum around T=2.4 is a real effect, or an artifact of the smoothing? When you only have 5 points, it&#039;s fine to display only the points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This isn&#039;t a quantum system though, and there isn&#039;t a maximum energy level. You&#039;re right that you can use these ideas to rationalise the trend - the fluid has modes which are analogous to quantum energy levels. The decrease in heat capacity shows that they become more closely spaced in energy at higher temperatures. The amount of energy required to move from one mode to the next thus decreases as temperature increases, and so does the heat capacity.&amp;lt;/span&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you say any more about this? Why is this the case?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The solid is 50% denser...&amp;lt;/span&amp;gt;&#039;&#039;&#039; This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation. I would move the discussion of r &amp;lt; sigma to the very start, to make it clear that it applies to all three phases.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Earlier you works out that the spacing for this very lattice should be around 1.49. Why do you think this is larger? You should use all three peaks to get an &amp;quot;average&amp;quot; lattice spacing to minimise the error in reading off the graph. What about the coordination numbers?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you think the reason for this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Do you think the uncertainties in the measurements are the same for both numbers of atoms?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Be careful with your notation here. That equation states that &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Careful again. On the left you have a function of t only, and on the right one that involves &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. A nicely present derivation, just be careful in future with those two lines at the start.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you say a bit more about this? Why does a collision lead to a minimum? If the harmonic oscillator has no collisions, why does it too have minima?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It would be good to see a side-by-side comparison of the MSD and VACF results. Which do you think is more accurate? Do you think the integration method is really the largest source of error?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535427</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535427"/>
		<updated>2016-02-17T15:29:55Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not seconds! These units are reduced.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]] &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, the ideal gas has no interactions between particles &#039;&#039;at all&#039;. Can you say more about this? If you used a purely attractive potential between the particles, would you see the same thing?&amp;lt;/span&amp;gt;&#039;&#039;&#039; The discrepancy can be seen to increase with pressure, this fits with the conclusion.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Thermal energy and kinetic energy are essentially interchangeable terms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t use the Excel &amp;quot;smoothed lines&amp;quot; feature for scientific plots. Do you think the maximum around T=2.4 is a real effect, or an artifact of the smoothing? When you only have 5 points, it&#039;s fine to display only the points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This isn&#039;t a quantum system though, and there isn&#039;t a maximum energy level. You&#039;re right that you can use these ideas to rationalise the trend - the fluid has modes which are analogous to quantum energy levels. The decrease in heat capacity shows that they become more closely spaced in energy at higher temperatures. The amount of energy required to move from one mode to the next thus decreases as temperature increases, and so does the heat capacity.&amp;lt;/span&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you say any more about this? Why is this the case?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The solid is 50% denser...&amp;lt;/span&amp;gt;&#039;&#039;&#039; This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation. I would move the discussion of r &amp;lt; sigma to the very start, to make it clear that it applies to all three phases.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Earlier you works out that the spacing for this very lattice should be around 1.49. Why do you think this is larger? You should use all three peaks to get an &amp;quot;average&amp;quot; lattice spacing to minimise the error in reading off the graph. What about the coordination numbers?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you think the reason for this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535424</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535424"/>
		<updated>2016-02-17T15:28:54Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not seconds! These units are reduced.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]] &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, the ideal gas has no interactions between particles &#039;&#039;at all&#039;. Can you say more about this? If you used a purely attractive potential between the particles, would you see the same thing?&amp;lt;/span&amp;gt;&#039;&#039;&#039; The discrepancy can be seen to increase with pressure, this fits with the conclusion.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Thermal energy and kinetic energy are essentially interchangeable terms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t use the Excel &amp;quot;smoothed lines&amp;quot; feature for scientific plots. Do you think the maximum around T=2.4 is a real effect, or an artifact of the smoothing? When you only have 5 points, it&#039;s fine to display only the points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This isn&#039;t a quantum system though, and there isn&#039;t a maximum energy level. You&#039;re right that you can use these ideas to rationalise the trend - the fluid has modes which are analogous to quantum energy levels. The decrease in heat capacity shows that they become more closely spaced in energy at higher temperatures. The amount of energy required to move from one mode to the next thus decreases as temperature increases, and so does the heat capacity.&amp;lt;/span&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you say any more about this? Why is this the case?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The solid is 50% denser...&amp;lt;/span&amp;gt;&#039;&#039;&#039; This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation. I would move the discussion of r &amp;lt; sigma to the very start, to make it clear that it applies to all three phases.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Earlier you works out that the spacing for this very lattice should be around 1.49. Why do you think this is larger? You should use all three peaks to get an &amp;quot;average&amp;quot; lattice spacing to minimise the error in reading off the graph. What about the coordination numbers?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535422</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535422"/>
		<updated>2016-02-17T15:24:47Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not seconds! These units are reduced.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]] &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, the ideal gas has no interactions between particles &#039;&#039;at all&#039;. Can you say more about this? If you used a purely attractive potential between the particles, would you see the same thing?&amp;lt;/span&amp;gt;&#039;&#039;&#039; The discrepancy can be seen to increase with pressure, this fits with the conclusion.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Thermal energy and kinetic energy are essentially interchangeable terms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t use the Excel &amp;quot;smoothed lines&amp;quot; feature for scientific plots. Do you think the maximum around T=2.4 is a real effect, or an artifact of the smoothing? When you only have 5 points, it&#039;s fine to display only the points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This isn&#039;t a quantum system though, and there isn&#039;t a maximum energy level. You&#039;re right that you can use these ideas to rationalise the trend - the fluid has modes which are analogous to quantum energy levels. The decrease in heat capacity shows that they become more closely spaced in energy at higher temperatures. The amount of energy required to move from one mode to the next thus decreases as temperature increases, and so does the heat capacity.&amp;lt;/span&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you say any more about this? Why is this the case?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535415</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=535415"/>
		<updated>2016-02-17T15:19:20Z</updated>

		<summary type="html">&lt;p&gt;Npj12: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not seconds! These units are reduced.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]] &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice plot&amp;lt;/span&amp;gt;&#039;&#039;&#039;The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Actually, the ideal gas has no interactions between particles &#039;&#039;at all&#039;. Can you say more about this? If you used a purely attractive potential between the particles, would you see the same thing?&amp;lt;/span&amp;gt;&#039;&#039;&#039; The discrepancy can be seen to increase with pressure, this fits with the conclusion.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Thermal energy and kinetic energy are essentially interchangeable terms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534249</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534249"/>
		<updated>2016-02-15T13:28:46Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds: &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: 0.3 reduced time units, be careful&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good -  a little more explanation would be nice (e.g. you know that theoretically 0.001 is more accurate, but this is not detectable at this precision.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534248</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534248"/>
		<updated>2016-02-15T13:26:32Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Can you elaborate a bit more on this? What sort of problems?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Unfortunately not. The input script you have always creates 1000 unit cells, no matter what type of lattice you ask for. The lattice type and density then specify how large the box is.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not in this case - it only specifies epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds:&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534247</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534247"/>
		<updated>2016-02-15T13:18:57Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: And what&#039;s this in kJ mol^-1&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds:&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534244</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534244"/>
		<updated>2016-02-15T13:08:01Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the error behaves like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit big, you should have found that 0.2 is the largest value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should say something like, &amp;quot;to see if the energy remains constant&amp;quot;, rather than &amp;quot;to show that it is constant&amp;quot;. You can&#039;t know until you&#039;ve checked.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds:&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534243</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534243"/>
		<updated>2016-02-15T13:04:51Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This is a bit confused. Does your graph show constant energy, or not?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds:&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534241</id>
		<title>Talk:Mod:Simulation of a Simple Liquid by Leo Hodges</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Simulation_of_a_Simple_Liquid_by_Leo_Hodges&amp;diff=534241"/>
		<updated>2016-02-15T12:54:25Z</updated>

		<summary type="html">&lt;p&gt;Npj12: Created page with &amp;quot;== Introduction to molecular dynamics simulation == &amp;#039;&amp;#039;&amp;#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscill...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1, \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the position using the analytical method is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = \cos(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is plotted below alongside the Velocity-Verlet, in order to show the comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Positionlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time using analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
They are shown to be in very good agreement. The absolute error between the two methods, i.e. the difference between the two, is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:Errorlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Difference between analytical and Velocity-Verlet methods]]&lt;br /&gt;
&lt;br /&gt;
The error between the two methods is ultimately very small but is periodic and increases as total time elapsed increases.&lt;br /&gt;
&lt;br /&gt;
The total energy is given by the sum of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; k = 1, m = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energylh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method]]&lt;br /&gt;
&lt;br /&gt;
The plot shows a wave oscillating around an average value, as expected for an ideal harmonic oscillator. The amplitude of oscillating is small and the total energy remains constant as there is no source of energy loss. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxlh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Linear correlation of error maxima]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The largest timestep that can be used, such that the amplitude of oscillation does not cause the energy to vary from the average by more than 1%, is 0.285. &lt;br /&gt;
&lt;br /&gt;
[[File:0285timesteplh2313.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Total energy as a function of time from the Velocity-Verlet method with 0.285 timestep]]&lt;br /&gt;
&lt;br /&gt;
By monitoring the energy of a system, it can be shown that it is constant, as expected for a closed system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{6}} = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^{6} = \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = 4\epsilon(\frac{6}{\sigma})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;e&amp;lt;/sub&amp;gt;, is the distance where &amp;lt;math&amp;gt;F = -\frac{d\phi\left(r\right)}{dr} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{\sigma^{13}} = \frac{6\sigma^6}{\sigma^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2\sigma^{6} = r^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_e = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can then be substituted into the Lennard-Jones equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^{2}\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)dr&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;\sigma = \epsilon = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2.5\sigma}^{\infty} = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{2\sigma}^{\infty} = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)|_{3\sigma}^{\infty} = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density of water at 298K is 0.997 g/cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;, therefore the mass of 1 mL of water is 0.997 g. The mass of a water molecule is 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{0.997}{2.99 \times 10^{-23}} = 3.33 \times 10^{23}\ molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10,000 water molecules would weight 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; and would occupy 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would be at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 \times 0.34 = 1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by &amp;lt;math&amp;gt;\epsilon = 120K/cdot1.38 \times 10^{-23}JK^{-1} = 1.656 \times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1.5 \times 1.656 \times 10^{-21}}{1.38 \times 10^{-23}}  = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are initially randomly positioned, it is possible that configurations are created where atoms are placed very close to one another. Such configurations may be physically impossible in reality and give extremely high Lennard-Jones potentials, causing problems and inaccuracies in simulations.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
&amp;lt;/pre&amp;gt; A simple cubic unit cell has one lattice point, thus the volume occupied by a lattice point is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^3 = 1.25000\ units^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the number density of lattice points is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25000}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centered unit cell contains four lattice points, so the length of the cubic unit cell with lattice number density of 1.2 is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{L^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;L = \sqrt[3]{\frac{4}{1.2}}=1.494&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Created orthogonal box = (0 0 0) to (10.7722 10.7722 10.7722)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic cell has a unit length of 1.494, so the created box will contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{10.7722}{1.494})^3 = 374.85\ unit\ cells&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic cell has 4 lattice points, thus the number of atoms created would be equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;374.85\times 4=1500\ atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;The first row defines only one type of atom and that they all have mass 1.0. The second row, &#039;&#039;pair_style, &#039;&#039;calculates the Lennard-Jones potential between pairs of atoms. The command has a cutoff argument, setting global cutoffs for all pairs of atoms, i.e. the maximum distance for which the Lennard-Jones potential can be calculated. In this case it is 3.0 but it can be smaller or larger than the dimensions of the simulation box. The final row, &#039;&#039;pair_coeff, &#039;&#039;overrides the global cutoff command for a specific pair of atoms.[[File:ThirdYearSimulationExpt-Intro-VelocityVerlet-flowchart.svg|321x321px|thumb|right|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Velocity Verlet algorithm.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity Verlet algorithm will be used as position and velocity are calculated at the same value of the time variable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
This set of code is such that no matter what you define the timestep to be, the same overall amount of time is run. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
If only the first second is plotted, it can be seen that the system reaches equilibrium in about 0.3 seconds:&lt;br /&gt;
&lt;br /&gt;
[[File:0.001 time e t p zoom lh2313.png|1382x1382px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: One second plots of time against energy, temperature and pressure for the 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
A plot of time versus energy for timesteps from 0.001 to 0.015 helps us choose the most appropriate timestep:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps(2).png|885x885px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep is clearly a bad choice because the system does not equilibrate and the energy gradually increases. The other timesteps all equilibrate and all look similar. A plot of the first second will differentiate between the remaining timesteps:&lt;br /&gt;
&lt;br /&gt;
[[File:Time vs energy varying timesteps zoom.png|885x885px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: One second plot of time against energy for varying timesteps]]&lt;br /&gt;
&lt;br /&gt;
0.01 is the largest timestep that equilibrates, however, 0.0025 appears to be a good choice because it matches the 0.001 timestep very closely, the smallest timestep but does not take as much time or oscillate as much.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen temperatures were T = 1.5, 2.0, 2.5, 3.0 and 6.0 at pressures p = 2.5 and 3.0. These simulations are to be performed with a 0.0025 timestep, owing to the previous conclusion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equating the equations gives us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&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;
&#039;&#039;&#039;Use the manual page to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
The penultimate line of code, starting &#039;&#039;fix aves&#039;&#039;, takes the defined inputs, such as density and pressure and averages them every set number of timesteps. How it does this is dictated by the numbers given in the line of code. These numbers represent  Nevery, Nrepeat and Nfreq respectively. The Nevery number is after every however many timesteps an input value is taken, in this case 100. Nrepeat is how many times the input values are used for calculating averages, 1000, and Nfreq calculates an average every this many timesteps, 100000 for this code. &lt;br /&gt;
&lt;br /&gt;
An average is taken every 100000 timesteps and an input value is taken every 100 timesteps, so 1000 measurements will contribute to the average. With a timestep of 0.0025 and 100000 timesteps to be run, 250 seconds will be simulated overall.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Densityvstemplh2313(3).png|793x793px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Density as a function of temperature plot]]The plot for the simulated density as a function of temperature of the liquid at different pressures follow very similar curves. As expected, the higher pressure gives a higher density along the curve. Error bars are included on both axes but are small; to the order of around 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; for density. The curves for the liquid at both pressures are lower than their respective ideal gas equivalent. This can be rationalised due to the fact that an ideal gas is considered to have no significant particle-particle interactions, while the liquid simulation takes into account Lennard-Jones interactions, so particles are more likely to be found further apart from one another. The discrepancy can be seen to increase with pressure, this fits with the conclusion. &lt;br /&gt;
&lt;br /&gt;
As temperature increases, the liquid and ideal gas curves converge, however. As the temperature increases, thermal kinetic energy overrides the intermolecular interaction effects and the liquid becomes more like an ideal gas.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The script used to perform the simulation for density 0.8 and temperature 2.0 is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.8&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
variable e2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_e v_e2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avetemp2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable avgesquare equal f_aves[3]&lt;br /&gt;
variable squareavge equal f_aves[2]*f_aves[2]&lt;br /&gt;
variable shola equal ${avgesquare}-${squareavge}&lt;br /&gt;
variable Cv equal atoms*atoms*${shola}/${avetemp2}&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable CvV equal ${Cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V: ${CvV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data from the ten simulations could then be plotted on the same graph in Excel:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat cap lh2313.PNG|793x793px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Cv/V as a function of temperature plot]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be seen to decrease as the temperature increases for both densities. This is an observation that can be rationalised by quantum mechanics. As the temperature increases, higher energy levels start to populate and consequently reduce the ability of the system to absorb further energy. This reduces the heat capacity. &lt;br /&gt;
&lt;br /&gt;
As for the difference between the trends for the two densities, the higher heat capacity for the greater density is also to be expected. A greater number of particles in an equivalent volume would be able to absorb more energy than a system with a lower density.&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
[[File:Lpgraph lh2313.PNG|360x360px|thumb|right|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Coexistence curve for the Lennard-Jones system (temperatures and densities in reduced units)&amp;lt;ref name=&amp;quot;ja00101a079&amp;quot;&amp;gt;Hansen, J., Verlet, L. &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;. &#039;&#039;Physical Review&#039;&#039;. &#039;&#039;&#039;1969&#039;&#039;&#039;. 184 (1), pp 154. {{DOI|10.1103/ja00101a079}}&amp;lt;/ref&amp;gt;]]&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density and temperature parameters for the three phases were chosen based on the phase diagram shown in Figure 13. The density of the gas, liquid and solid were 0.05, 0.8 and 1.2 respectively, while the temperature for all the phases was 1.2.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFcombinedlh2313.PNG|1242x1242px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Radial Distribution Function for three phases (left) and solid (right)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lh23132.jpg|500px|thumb|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Face centred cubic unit cell|right]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how the density in a system of particles varies as a function of distance from a reference particle, in this case a randomly chosen atom. Essentially, it is the probability of finding a particle at a certain distance away from the reference particle, relative to an ideal gas. &lt;br /&gt;
&lt;br /&gt;
The densities of the solid and the liquid are similar, so the separation of molecules would be expected to be similar. This is the case but the fundamental difference between the two phases is the presence of long-range order in the solid state that is not seen in the liquid state. Three peaks can be seen for the liquid phase at low internuclear distances before the amplitude diminishes to 1. The short range order observed, despite the constant motion of particles in a liquid can be explained by coordination shells. The distances between the randomly chosen particle and the particles in the first coordination shell is much shorter than for the second coordination shell, which in turn is shorter than the third until there is essentially no coordination, hence the amplitude of 1. &lt;br /&gt;
&lt;br /&gt;
For the face centred cubic solid state, however, the first three peaks are found at similar internuclear distances as that of the liquid but the amplitude does not diminish to the same extent and the peaks are more clearly defined than in the liquid. This is because in a solid, the atoms are in fixed positions and can be defined consistently regardless of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the case of the gas there is only one peak due to very little &#039;local structure&#039;. At distances shorter than the atomic diameter, g(r) is zero due to strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
Due to the fixed nature of atoms in the face centred cubic lattice, the internuclear distance of the peaks, as shown in Figure 14, can be used to find the lattice spacing. Figure 15 shows the internuclear distances the peaks correspond to, in the context of a face centred cubic unit cell.&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, the density of the vapour is 0.05, the liquid is 0.8 and the solid 1.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourmsdlh2313.png|841x841px|thumb|center|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Mean square displacement for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Ultimately, all of the phases show a linear correlation between the mean square displacement and the number of timesteps. In the case of the vapour phase, this is after an initial 1500 timesteps of non-linearity. This allows us to use the gradient of the slope in the equation shown above to estimate the diffusion coefficient, D. As the differential is with respect to time, t, we must divide the gradient by the length of the timestep, 0.002. With a gradient of 0.0374, we obtain for the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.0374}{0.002} = 3.11&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms, we obtain a very similar coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.037}{0.002} = 3.08&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Liquidmsdlh2313.png|919x919px|thumb|center|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Mean square displacement for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
The liquid phase has a very close linear trend from the very first timestep. It also exhibits a much smaller overall mean square displacement at the final timestep compared to the vapour, thus also a smaller gradient. The value for the coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{0.001}{0.002} = 0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same diffusion coefficient is obtained for 1 million atoms as the gradient of the slope is the same. &lt;br /&gt;
&lt;br /&gt;
[[File:Solmsdlh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 18&#039;&#039;&#039;: Mean square displacement for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
Finally, the solid phase shows linearity after around 250 timesteps but in this case the gradient is very close to zero. A very small overall mean square displacement is to be expected for a face centred cubic lattice with fixed atoms. The diffusion coefficient is calculated to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be seen that throughout the calculations of the three phases, simulating one million atoms provided very little benefit and is unnecessary. The only noticeable difference being the smoother gradient in the mean square displacement plot for the solid phase.&lt;br /&gt;
&lt;br /&gt;
We can also calculate the diffusion coefficient using the &#039;&#039;velocity autocorrelation function&#039;&#039;, which we denote by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positiion of a classical harmonic oscillator is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = A\cos\left(\omega (t + \tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be differentiated with respect to t, using the chain rule, to give us the velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dx(t)}{dt} = v(t) = -A\omega\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be substituted into:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega (t + \tau) + \phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can use the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)[\sin(\omega t + \phi)\cos(\omega \tau) + \cos(\omega t + \phi)\sin(\omega \tau)]dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi) + \sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \frac{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)\cos(\omega \tau)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)\sin(\omega \tau)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt}{\int_{-\infty}^{\infty}\sin^2(\omega t + \phi)dt} + \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bottom integral does not converge but the top integral is a combination of an even and an odd function, therefore as long as the limits are equal and opposite, the integral will tend to zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(\omega t + \phi)\cos(\omega t +\phi)dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf lh23132.PNG|925x925px|thumb|center|&#039;&#039;&#039;Figure 19&#039;&#039;&#039;: Velocity autocorrelation function for the solid and liquid phases and the harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima on the plots represent collisions with other atoms. The solid plot shows a decaying nature after the initial collision on the solid plot due to its high degree of order, while the liquid exhibits only one minima. This represents a collision with the solvent cage. There are no collisions in the case of the harmonic oscillator, so the amplitude of the periodic wave remains constant. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A running integral of the VACF can be approximated using the trapezium rule, allowing us the estimate the diffusion coefficient with the below equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\cdot\frac{1\times 10^{-8}}{0.002} = 8.3\times 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapourvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 20&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the vapour phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient works out to be 3.294 and for the 1 million atom system, 3.268. This is similar to the result obtained above from the mean square displacement method. &lt;br /&gt;
&lt;br /&gt;
[[File:Liquidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 21&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the liquid phase]]&lt;br /&gt;
&lt;br /&gt;
A value of 0.0977 is obtained for the liquid phase diffusion coefficient and 0.09 for the equivalent 1 million atom system, which is again similar to the previous method.&lt;br /&gt;
&lt;br /&gt;
[[File:Solidvacflh2313.png|925x925px|thumb|center|&#039;&#039;&#039;Figure 22&#039;&#039;&#039;: Running integral of the velocity autocorrelation function for the solid phase]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for the solid is again essentially zero which is to be expected. A value of 1.84 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; is calculated for the diffusion coefficient and 4.53 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; for the 1 million atom system. It can again be seen that there is little difference in the result from the 1 million atom simulation and it is therefore unnecessary to simulate such a large number of atoms. More accurate estimations of the diffusion coefficient could be obtained by using more sophisticated methods of approximating the integral.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534207</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534207"/>
		<updated>2016-02-13T18:47:02Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t just join up the points on the graph with lines - it&#039;s fine to just use points if you like, or to fit a curve.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. How does the discrepancy change with temperature? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You shouldn&#039;t use the Excel &amp;quot;smooth curve&amp;quot; drawing either - do you think it&#039;s more likely that the peak is a real trend, or that the points have measurement error which distorts the pattern?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you explain why it varies with temperature as it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not quite, but this is a good effort - in the vapour, there is a &#039;&#039;constant&#039;&#039; probability of finding another atom. In other words, there is no order or structure. In general, we say that a gas has no order, a liquid has short range but no long range order, and a crystalline solid has both short and long range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Does this agree with the FCC lattice spacing that you worked out earlier for this density? You could also work out the distances for the other two peaks, and use those to estimate the lattice spacing too.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Well spotted&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should only fit the gradient for the vapour in the second half, where it is approximately linear. Good otherwise. &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Yes - in fact, for the harmonic oscillator there are no other atoms. There&#039;s nothing with which it can collide and decorrelate.&amp;lt;/span&amp;gt;&#039;&#039;&#039; The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not true, the atoms are in constant motion.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why is the solid more constrained?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: So which method do you think is better?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534206</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534206"/>
		<updated>2016-02-13T18:43:06Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Mean squared displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t just join up the points on the graph with lines - it&#039;s fine to just use points if you like, or to fit a curve.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. How does the discrepancy change with temperature? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You shouldn&#039;t use the Excel &amp;quot;smooth curve&amp;quot; drawing either - do you think it&#039;s more likely that the peak is a real trend, or that the points have measurement error which distorts the pattern?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you explain why it varies with temperature as it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not quite, but this is a good effort - in the vapour, there is a &#039;&#039;constant&#039;&#039; probability of finding another atom. In other words, there is no order or structure. In general, we say that a gas has no order, a liquid has short range but no long range order, and a crystalline solid has both short and long range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Does this agree with the FCC lattice spacing that you worked out earlier for this density? You could also work out the distances for the other two peaks, and use those to estimate the lattice spacing too.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Well spotted&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You should only fit the gradient for the vapour in the second half, where it is approximately linear. Good otherwise. &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534205</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534205"/>
		<updated>2016-02-13T18:41:18Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t just join up the points on the graph with lines - it&#039;s fine to just use points if you like, or to fit a curve.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. How does the discrepancy change with temperature? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You shouldn&#039;t use the Excel &amp;quot;smooth curve&amp;quot; drawing either - do you think it&#039;s more likely that the peak is a real trend, or that the points have measurement error which distorts the pattern?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you explain why it varies with temperature as it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Not quite, but this is a good effort - in the vapour, there is a &#039;&#039;constant&#039;&#039; probability of finding another atom. In other words, there is no order or structure. In general, we say that a gas has no order, a liquid has short range but no long range order, and a crystalline solid has both short and long range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Does this agree with the FCC lattice spacing that you worked out earlier for this density? You could also work out the distances for the other two peaks, and use those to estimate the lattice spacing too.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534204</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534204"/>
		<updated>2016-02-13T18:29:10Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t just join up the points on the graph with lines - it&#039;s fine to just use points if you like, or to fit a curve.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. How does the discrepancy change with temperature? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: You shouldn&#039;t use the Excel &amp;quot;smooth curve&amp;quot; drawing either - do you think it&#039;s more likely that the peak is a real trend, or that the points have measurement error which distorts the pattern?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Can you explain why it varies with temperature as it does?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534203</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534203"/>
		<updated>2016-02-13T18:27:37Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Don&#039;t just join up the points on the graph with lines - it&#039;s fine to just use points if you like, or to fit a curve.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. How does the discrepancy change with temperature? &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534202</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534202"/>
		<updated>2016-02-13T18:24:25Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why did you choose this, not 0.0025?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534201</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534201"/>
		<updated>2016-02-13T18:23:24Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Checking equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - because making it any smaller (although it technically makes the results more accurate), doesn&#039;t gain you anything.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534200</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534200"/>
		<updated>2016-02-13T18:22:02Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Checking equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, be careful - the time is in reduced units. Good otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534199</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534199"/>
		<updated>2016-02-13T18:20:49Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Running the simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Okay, but what&#039;s the difference? Why does the first version do that, and not the second?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534198</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534198"/>
		<updated>2016-02-13T18:19:59Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Setting the properties of the atoms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: What do you mean by forcefield coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534197</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534197"/>
		<updated>2016-02-13T18:17:34Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Reduced units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534196</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534196"/>
		<updated>2016-02-13T18:08:51Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534195</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534195"/>
		<updated>2016-02-13T18:08:13Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good - you could simplify this further to 24...&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534194</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534194"/>
		<updated>2016-02-13T18:07:30Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Why do you think the maximum error grows like this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534193</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534193"/>
		<updated>2016-02-13T18:05:00Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Reduced units, not seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534192</id>
		<title>Talk:Jmt12ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Jmt12ls&amp;diff=534192"/>
		<updated>2016-02-13T18:03:59Z</updated>

		<summary type="html">&lt;p&gt;Npj12: Created page with &amp;quot;= Simulation of a simple liquid =   ==Introduction==  Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a l...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Simulation of a simple liquid = &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics is an important way to simulate liquids. The interactions between atoms for a specific ensemble in a liquid are studied, over a given time&amp;lt;ref&amp;gt; H. C. Andersen, &#039;&#039;J. Chem. Phys&#039;&#039;., 1980, &#039;&#039;&#039;72&#039;&#039;&#039;, 2384 &amp;lt;/ref&amp;gt;. A number of approximations must be made so that the computations are possible. It is assumed that the particles behave as classical particles and they are subjected to a force which originates from the interactions of the other particles. This force is the reason that the particles accelerate.&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
&lt;br /&gt;
The Harmonic oscillator was modeled using the velocity Verlet algorithm and the following graphs were produced from this. The first graph was made by plotting the value of the classical solution for the harmonic oscilator against time, from 0 seconds to 14.2 seconds. The second graph was an error plot of the absolute difference between the approximate values from the velocity Verlet solution and the values obtained from the harmonic oscillator equation. The third graph was produced by calculating the sum of the potential and kinetic energy for the velocity Verlet solution at each time. The values used in these calculations were; k = 1.00, mass = 1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00, A = 1.00, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 and a timestep of 0.100. &lt;br /&gt;
&lt;br /&gt;
The positions at a time, &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; were calculated by use of the equation ;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The energies were calculated by using the equation; &amp;lt;math&amp;gt; E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical.png|center|475px|thumb|Graph 1 - Analytical]]&lt;br /&gt;
| [[File:Jmt12-intro-error.png|center|475px|thumb|Graph 2 - Error]]&lt;br /&gt;
| [[File:Jmt12-intro-energy.png|center|475px|thumb|Graph 3 - Total energy]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the tables below, everything was calculated in the same way as above, however, this time, the value of k was increased from 1.00 to 5.00. It is evident by comparison that increasing the value of the force constant (k) has increased the frequency of vibrations. This is because, it is known that;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
so by looking at the equation above, it is obvious that if the force constant, &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is increased, this will therefore also cause the frequency, &amp;lt;math&amp;gt; \omega &amp;lt;/math&amp;gt; to also increase. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-analytical (2).png|center|475px|thumb|Graph 4 - Analytical (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-error (2).png|center|475px|thumb|Graph 5 - Error (increased k)]]&lt;br /&gt;
| [[File:Jmt12-intro-energy (2).png|center|475px|thumb|Graph 6 - Total energy (increased k)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The equation &amp;lt;math&amp;gt; \omega = \sqrt\frac{k}{\mu} &amp;lt;/math&amp;gt; also shows that the frequency will also increase if all of the values are kept the same apart from if the mass is decreased. This can be seen in the tables below, where the mass was decreased from 1.00 to 0.25. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-intro-mass-analytical.PNG|center|475px|thumb|Graph 4a - Analytical (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-error.PNG|center|475px|thumb|Graph 5a - Error (decreased mass)]]&lt;br /&gt;
| [[File:Jmt12-intro-mass-energy.PNG|center|475px|thumb|Graph 6a - Total energy (decreased mass)]] &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Graph 7 was produced by plotting each maxima value for the error plot against time. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-error-maxima.png|center|475px|thumb|Graph 7 - Error maxima]]&lt;br /&gt;
&lt;br /&gt;
So that the difference in energy does not change by more than 1%, the largest value of the timestep would need to be 0.200. This was calculated because if the total energy at its highest is 0.500, then the total energy at its lowest must not be smaller than 0.495. The value of the timestep was changed and the difference between the energy minima and maxima was calculated. The graph for the energy that was produced for this timestep value can be seen in graph 8, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-energy-1percent.png|center|475px|thumb|Graph 8 - Energy graph with total energy difference at 1%]] &lt;br /&gt;
&lt;br /&gt;
A larger value for the timestep was inserted to show that the overall energy did change by more than 0.495 when the timestep was increased past 0.200. The graph that was produced from a timestep of 0.250 shown below as graph 9. The lowest value for the total energy at this timestep is 0.492. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-intro-timestep0.25.png|center|475px|thumb|Graph 9 - Energy difference above 1%]] &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically so that you know that the law of conservation of energy has been obeyed. If it has not, then the simulation will not accurately reflect a real system.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces === &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to simulate the interactions between a pair of atoms in a simple liquid. For a single Lennard-Jones interaction,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When the potential energy is equal to zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}} = \frac{r^{12}}{r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r^6}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and therefore &amp;lt;math&amp;gt;r_0 = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At this separation the force is calculated from &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; is substituted into &lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = -4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{-6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r = \sigma &amp;lt;/math&amp;gt; then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}} - \frac{6\sigma^6}{\sigma^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium, we are at the bottom of the curve and the derivative of the Lennard-Jones potential and also the force can be set to equal 0. The value of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; will then be equal to the equilibrium separation, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} \right) =4\epsilon \left( \frac{6\sigma^6}{r^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{r^{13}}  = \frac{24\epsilon\sigma^6}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;   \frac{48\epsilon\sigma^{12}}{24\epsilon\sigma^6}  = \frac{r^{13}}{r^7} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  2\sigma^{6}  = {r^6} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = ^{6}\sqrt2\sigma &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, can be found by substituting this value for &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To give &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{(^{6}\sqrt2\sigma)^{12}} - \frac{\sigma^6}{(^{6}\sqrt2\sigma)^6} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma} - \frac{\sigma^6}{2\sigma} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = \left( \frac{4\epsilon}{4} - \frac{4\epsilon}{2} \right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \sigma = \epsilon = 1.0 &amp;lt;/math&amp;gt;; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4 \left(r^{-12} - r^{-6} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{x}^\infty \phi\left(r\right)\mathrm{d}r = 4 \left( \frac{-r^{-11}}{11} + \frac{r^{-5}}{5} \right)^{\infty}_{x} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The below integrals were then evaluated; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =-8.17 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-3.29 \times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
Under standard conditions, in 1 ml of water;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{1}{18} = 0.0555 moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; no.atoms = 0.0555\times(6.022\times10^{23}) = 3.345\times10^{22} &amp;lt;/math&amp;gt; in 1ml &lt;br /&gt;
&lt;br /&gt;
For 10000 atoms;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac{10000}{6.022\times10^{23}} = 1.6606\times10^{-20} moles &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; mass = moles\times molarmass = (1.6606\times10^{-20}) \times 18 = 2.989\times10^{-19}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume = \frac{mass}{density} = \frac{2.989\times10^{-19}}{1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 2.989\times10^{-19} cm^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If an atom at position &amp;lt;math&amp;gt; \left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right) to \left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, the atom would end up at position &amp;lt;math&amp;gt; \left(0.2, 0.1, 0.7\right) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When looking at the Lennard-Jones potential, reduced units are usually used instead of real units. This is done so that the values are more manageable.  &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units this would be &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.2 = \frac{r}{0.34}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = 1.088nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?  &lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi = -\epsilon &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and because, from above; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = \frac{-120 \times \ k_B  \times N_{A}}{1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = -0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ = 120\ k_B  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{120 k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.5 = \frac{T}{120}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration == &lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
For this, five different simulations were run using LAMMPS. Each simulation was run with a different timestep value; 0.001, 0.0025, 0.0075, 0.01 and 0.015. &lt;br /&gt;
&lt;br /&gt;
It is easier to create starting points for the simulation if we are dealing with a crystal structure rather than if we are dealing with a liquid. This is because the crystal structure could simply be looked up but random starting points would have to be generated for a liquid. However, if atoms are given random starting coordinates then they may be have too strong a repulsion from each other, this means that they will be forced away from each other and cause issues in the simulation. &lt;br /&gt;
&lt;br /&gt;
If the distance between the points of lattice is 1.07722 then the volume of the cube is equal to; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.07722^3 = 1.2500 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{volume} = density&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{1.2500} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now look at a face centered cubic lattice, with a lattice point number density of 1.2 then, as there is a total of 4 whole atoms in the cube;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2} = 3.333&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = 3.333 &amp;lt;/math&amp;gt; therefore the &amp;lt;math&amp;gt;length = 3.333^\frac{1}{3} = 1.494 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we were to use the create_atoms command for 1000 units of the face centered cubic lattice then it would have created &amp;lt;math&amp;gt;4\times 1000 = 4000 atoms&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
The LAMMPS manual defines the following commands as:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - this command sets all atoms of type 1 (which is all of our atoms) to a mass of 1.0&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - this command computes pairwise interactions. These interactions are assessed within a specific boundary, or cut off point, in this case the cut off point is set as 3.0. lj in this command means Leonard Jones. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - this command is to define the pairwise force field coefficients between a pair(s) of atom types.&lt;br /&gt;
&lt;br /&gt;
We are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; which means that the velocity Verlet algorithm is being used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
In the code, the below is written: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This section of the code is present because we want to tell LAMMPS that every time, after this code, it comes across ${timestep} we want it to replace it with 0.001, in this case. &lt;br /&gt;
&lt;br /&gt;
We are not able to simply write: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of writing the first command, above, because we want to keep the overall time the same and just change the timestep. The second, simpler code would change both the timestep and the total time of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Visualising the trajectory=== &lt;br /&gt;
&lt;br /&gt;
The trajectories can be viewed using the VMD programme as can be seen in figure 1, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-atomcube.png|center|475px|thumb|Figure 1 - Representation of the atoms]] &lt;br /&gt;
&lt;br /&gt;
The periodic boundary conditions can also be visulaised using the VMD programme. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-2atomscube.png |center|475px|thumb|Figure 2 - Representation of two atoms]]&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration=== &lt;br /&gt;
&lt;br /&gt;
Here, the thermodynamic data will be used to see if the system has reached equilibrium. As can be seen from graphs 10, 11 and 12, below, the system does reach equilibrium. This is evident because, initially, there is a large change in the three graphs representing the energy, temperature and pressure. However, after this large change, the three variables then begin to fluctuate about the average, which must be the equilibrium state. It takes approximately 0.42 seconds by looking at the graphs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-eq-energyvstime.png |center|475px|thumb|Graph 10 - Energy vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-tempvstime.png |center|475px|thumb|Graph 11 - Temperature vs time (0.001 timestep)]]&lt;br /&gt;
| [[File:Jmt12-eq-pressurevstime.png |center|475px|thumb|Graph 12 - Pressure vs time (0.001 timestep)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graph 13 shows the difference in the energy over time for each of the five timesteps under analysis. A shorter timestep means that the calculated results will be closer to the experimental results, however, the shorter timestep also means that the measurements will have to take place over a shorter amount of time. This can be an issue if it is required that the calculations be run over a long period. As can be seen from graph 13 the timesteps with values of 0.001, 0.0025, 0.0075 and 0.01 all reach equilibrium. The data corresponding to the longest timestep of 0.015 shows the largest deviation from reality. This set of data does not reach an equilibrium and instead the the energy continues to rise, thus disobeying the law of conservation of energy. This timestep would therefore be the worst choice. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-evst-all.png |center|650px|thumb|Graph 13 - Comparison of energy vs time for all timesteps]] &lt;br /&gt;
&lt;br /&gt;
By looking at graph 14, it can be seen that the data series corresponding to the two smallest timestep values deviate the least from the average value whilst the data for the timestep values of 0.075 and 0.01 deviate noticeably more. It can be concluded that the largest timestep which still gives accurate results is the 0.0025 value. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-eq-zoom.png |center|650px|thumb|Graph 14 - Comparison of energy vs time for all timesteps (zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, the simulations were modified so that the NpT (isobaric-isothermal) ensemble conditions were followed. The previous section simulated the liquid under microcanonical (NVE) ensemble conditions. &lt;br /&gt;
&lt;br /&gt;
Ten simulations were run for this section. The timestep was set to &#039;&#039;&#039;0.001&#039;&#039;&#039; because then the most accurate results would be obtained. Five different temperatures were chosen. These temperatures needed to be higher than the critical temperature of T* = 1.5. The temperatures that were chosen were &#039;&#039;&#039;T = 1.6, 2.6, 3.6, 4.6, 5.6&#039;&#039;&#039;. Finally, two pressures needed to be chosen. These were chosen by looking at the average pressure from graph 12. The pressures that were chosen were &#039;&#039;&#039;p = 2.50 and 3.00&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Each of the five temperatures were run at each of the two pressures for a timestep of 0.001.  &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
In statistical thermodynamics, the equipartition theorem states that every degree of freedom for a system at equilibrium has an energy equal to &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt;. As we are considering a system of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms which each have three degrees of freedom, the following equation can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T  ( equation 1)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After every timestep, the kinetic energy can be calculated using equation 1. We use the left side of the equation and then divide this by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B &amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, the instantaneous temperature, can be calculated. We want this instantaneous temperature to equal the temperature that was specified in the script, the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. This can be achieved by multiplying each velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. This constant is calculated by solving equation 1 and equation 2. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (equation 1)&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} (equation 2)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This can be done by dividing equation 2 by equation 1 to obtain: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script=== &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above line is present in the input script. This line tells LAMMPS to take an average of certain values over a certain number of timesteps. The order that the values are inserted is important. &lt;br /&gt;
&lt;br /&gt;
The first value, which in this case is &#039;&#039;&#039;100&#039;&#039;&#039;, corresponds to Nevery. This means that the values will be averaged every 100 timesteps. &lt;br /&gt;
&lt;br /&gt;
The second value, &#039;&#039;&#039;1000&#039;&#039;&#039;, corresponds to Nrepeat. This means that LAMMPS will use 1000 input values to calculate the averages.&lt;br /&gt;
&lt;br /&gt;
The final value, &#039;&#039;&#039;100000&#039;&#039;&#039;, corresponds to Nfreq. LAMMPS will therefore calculate averages every 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
The amount of time that will be simulated is 100000.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State=== &lt;br /&gt;
&lt;br /&gt;
The density as a function of temperature was plotted for both of the chosen pressures. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-npt-2.5.PNG |center|475px|thumb|Graph 15 - Density as a function of temperature at p=2.5]]&lt;br /&gt;
| [[File:Jmt12-npt-3.PNG |center|475px|thumb|Graph 16 - Density as a function of temperature at p=3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As can be seen from the graphs, both of the plots of density as a function of temperature are higher for the plot using the density predicted by the ideal gas law than for the computed density. This is because the ideal gas equation assumes that the atoms do not interact with each other. This means that there would be less repulsion between atoms and they will therefore will not have to be as far away from each other as they would in reality. As;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \frac{mass}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and because the atoms are able to be closer together, the volume will be decreased due to the ideal gas law. From the equation above, then, by decreasing the volume, the density will have to increase as the mass is kept constant.&lt;br /&gt;
&lt;br /&gt;
From the graphs, the higher the temperature is, the lower the density is. This is due to an increase in kinetic energy with rising temperature, meaning that the atoms will be further apart from each other and therefore the density will decrease.  &lt;br /&gt;
&lt;br /&gt;
The data points for both pressures were plotted on the same axes to compare the deviation from the ideal gas equation plots at the two different pressures. The graph below shows that increasing the pressure leads to more deviations from the density predicted by the ideal gas equation. This can be explained because the ideal gas law ignores interactions with other atoms. At lower densities, in a real system, there will be fewer interactions taking place. This means that at lower densities, properties of a real system are more reflective of the same properties as predicted by the ideal gas law. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-dens vs pressure(2).PNG |center|500px|thumb| Density as a function of temperature at p=2.5, p=3]]&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
This section concentrated on the NVT ensemble. As the temperature is being held constant, in its equilibrium state, the energy must be fluctuating about an average value. These fluctuations about the average relate to the magnitude of the heat capacity according to the equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input files for this section were a modification of the file from the previous section. &lt;br /&gt;
&lt;br /&gt;
Again, ten different simulations were run for this section, but this time in the density-temperature phase space. &lt;br /&gt;
&lt;br /&gt;
The simulations were run at two densities of &#039;&#039;&#039;0.2&#039;&#039;&#039; and &#039;&#039;&#039;0.8&#039;&#039;&#039; and five temperatures of &#039;&#039;&#039;2.0, 2.2, 2.4, 2.6&#039;&#039;&#039; and &#039;&#039;&#039;2.8&#039;&#039;&#039;. The graph below shoes a plot of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; as a function of temperature. An example of one of the input files used can be found [https://wiki.ch.ic.ac.uk/wiki/images/0/03/Temp2_density0.2.in here]. This is for a temperature of 2.0 and a density of 0.2.  &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph(2).png |center|650px|thumb|Graph 19 - Cv vs T for density of 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The below graph shows &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature. The volume was calculated by &amp;lt;math&amp;gt;\frac{number of atoms}{density} = volume&amp;lt;/math&amp;gt;. The number of atoms for both densities was 3375. This gave a volume of 16875 for the density of 0.2 and a volume of 4218 for the density of 0.8&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-heatcap-graph.png |center|650px|thumb|Graph 20 - Cv/V vs T for density of 0.2 and 0.8]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from the above graph, as the temperature increases, the heat capacity per unit volume decreases. The simulation at the higher density has a larger heat capacity compared to the lower density one for the same temperature. The higher the density, the higher the number of atoms will be when we are looking at an equal volume. The heat capacity is an extensive property of the system. This means that as the size of the system increases, the heat capacity will also increase, which is supported by looking at the graph above.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function (RDF), &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;, is a measure of density with respect to the distance from an atom. Using this function, the distance of the nearest neighbours of a certain atom can be calculated. &lt;br /&gt;
&lt;br /&gt;
[http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 This journal] &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;. provided the phase diagram of the Leonard-Jones potential that was used to choose the pressures and temperatures of a solid, liquid and gas that the simulations in this sections were run with. The table below shows these differing values for the different phases.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2&lt;br /&gt;
| 0.6&lt;br /&gt;
| 0.09&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The results of the simulations of the Leonard-Jones system were then used in VMD to calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The RDFs of a (fcc) solid, a liquid and a vapour are shown on the same axis, for comparison, in graph 21, below. &lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-rdf-slg(2).png |center|650px|thumb|Graph 21 - RDFs for solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
Graph 21 shows the probability of finding at atom at different distances with respect to another atom, with each peak representing the position of an atom. &lt;br /&gt;
The graph shows that up to a distance of about 0.8, there is zero probability of finding another atom. This is true for all of the three phases because of the high repulsion forces at such short distances.  The solid has many sharp peaks which correspond to the strict ordering of a crystalline solid. The peaks are also still present and visable at longer distances of r, which is not true for either a liquid or a vapour. Only a few, more broad peaks can be seen at short distances for the liquid, these peaks reflect the solvent shell of the atom under consideration. At longer distances, the probability tends to 1 which shows that there is a high degree of disorder at longer distances and a smaller probability of finding at atom at that position. Only a single peak can be seen for the vapour, there is a very high degree of disorder in this phase which means that there is a very low probability of finding an atom after the nearest neighbour. &lt;br /&gt;
&lt;br /&gt;
The first three peaks for the solid correspond to the first three nearest neighbours. These peaks can be found at distances of 1.025, 1.525 and 1.825 which can be seen as 1, 2 and 3 respectively on figure 3 (edited from http://www.saylor.org/content/watkins_flattice/04fig01.gif).&lt;br /&gt;
[[File:Jmt12-fcc.png |center|350px|thumb| Figure 3 - FCC lattice - nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
It is obvious from figure 3 that the lattice spacing in this lattice is just the difference between the atom under consideration and the atom labelled 2. Therefore, the lattice spacing must just be equal to the distance between the origin and the second nearest neighbour. The lattice spacing is equal to &#039;&#039;&#039;1.525&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the atoms corresponding to the first three peaks of the FCC solid RDF can be calculated by comparing the number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot for the solid phase (graph 22) with the RDF plot for the solid (graph 23).&lt;br /&gt;
&lt;br /&gt;
In graph 23, it can be seen that the first peak reaches a minimum at 1.275. If this figure for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is read off the &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; curve, then a value for the number integral can be obtained which corresponds to this peak; the coordination number for the first peak is therefore &#039;&#039;&#039;12&#039;&#039;&#039;. This process is then repeated for the second peak, it reaches a minimum at 1.625 and the corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is 18. If the coordination number of the first peak is then subtracted from 18 then the coordination for the second peak can be obtained; &#039;&#039;&#039;6&#039;&#039;&#039;. If this is repeated once more, for a minumum in the RDF plot at 1.975 and corresponding number integral over &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; of 42. Subtraction then leaves a coordination number of &#039;&#039;&#039;24&#039;&#039;&#039; for peak three.   &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-rdf-integral solid.png |center|550px|thumb|Graph 22 - Number integral over g(r)vs r (solid)]]&lt;br /&gt;
|[[File:Jmt12-rdf-solid.png |center|550px|thumb|Graph 23 - RDF for the solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient== &lt;br /&gt;
&lt;br /&gt;
This section will concentrate on the amount that the atoms in the system move around. This will be done by calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
===Mean squared displacement===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by using its connection to the mean squared displacement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It is a measure of the spatial extent of random motion. The mean squared value is taken to ensure that a positive value is obtained. &lt;br /&gt;
&lt;br /&gt;
First, three simulations were run; on a solid, a liquid and a vapour. The temperature and density values from the previous section were used in the input files. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid.png|center|480px|thumb|Graph 24 - Total mean squared displacement of the solid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid (trendline).png|480px|thumb|Graph 25 - Total mean squared displacement of the liquid as a function of timestep]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL(timestep).PNG|center|480px|thumb|Graph 26 - Total mean squared displacement of the vapour as a function of timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Graphs 24, 25 and 26 show the total mean squared displacement as a function of timestep for the three phases, solid, liquid and vapour respectively. It would be expected that the graphs would be of a linear fashion. This trend is followed for the plot of the liquid. However, the vapour plot can be seen to have a slight curve at the beginning. This is due to the lack of collisions at the start of the simulation in the low density vapour phase - the trend becomes linear after a collison. An atom in the high density solid is unable to move in a random fashion therefore the expected linear trend is not observed.&lt;br /&gt;
&lt;br /&gt;
To calculate the diffusion coefficient, the x axis needs to be converted from units of timesteps to units of time. This can be seen in graphs 27, 28 and 29. The diffusion coefficient for these two graphs can therefore be calculated from the gradient of the data points. &lt;br /&gt;
The gradient is multiplied by &amp;lt;math&amp;gt; \frac{1}{6}&amp;lt;/math&amp;gt; to obtain &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Thus, if the graph for the liquid is considered first, the equation that resulted from the linear trendline was &amp;lt;math&amp;gt;y = 1.1387x - 0.3091 &amp;lt;/math&amp;gt;. The diffusion coefficient is therefore &amp;lt;math&amp;gt;1.387 (\frac{1}{6}) = 0.190 &amp;lt;/math&amp;gt; This process is also repeated for the solid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-MSD-solid(2).PNG|center|480px|thumb|Graph 27 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-liquid(2).PNG|480px|thumb|Graph 28 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-MSD-vapFINAL.PNG|center|480px|thumb|Graph 29 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resulting gradients are shown in the below table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 1.1387&lt;br /&gt;
| 14.502&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.190&lt;br /&gt;
| 2.417&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above was repeated for a system of 1 million atoms. The total mean squared displacement as a function of time plots are shown in graphs 30, 31 and 32 and the resulting gradients and diffusion coefficients can be seen below. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Gradient&lt;br /&gt;
| 3x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.5236&lt;br /&gt;
| 15.249&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 5x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0873&lt;br /&gt;
| 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:Jmt12-msd-solid-mil(2).PNG|center|480px|thumb|Graph 30 - Total mean squared displacement of the solid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-liquid-mil(2).PNG|480px|thumb|Graph 31 - Total mean squared displacement of the liquid as a function of time]]&lt;br /&gt;
|[[File:Jmt12-msd-vap-mil(2).PNG|center|480px|thumb|Graph 32 - Total mean squared displacement of the vapour as a function of time]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The gradient of the plot for the solid was not taken over the entire graph, it was only taken over the section from graph 33.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-msd-solid-zoom.PNG|center|480px|thumb|Graph 33 - Total mean squared displacement of the solid as a function of time]] &lt;br /&gt;
&lt;br /&gt;
Comparison of the graphs of the systems of different sizes shows that the simulation with one million atoms provides smoother plots, this is to be expected for a larger system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
An alternative way of calculating the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is to use the velocity autocorrelation function which is given by the below equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function states the difference in velocity at a time,  &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;, compared with the starting time, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was used to evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
* because &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* and we know that &amp;lt;math&amp;gt; v = \frac{dx}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* the first equation can be differentiated to give &lt;br /&gt;
&amp;lt;math&amp;gt; v(\tau) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*and therefore&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* If this is substituted into&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then this produces &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))(-A\omega\sin(\omega (t+\tau) + \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega\sin(\omega t + \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{-A^2\omega^2\int_{-\infty}^{\infty} (\sin(\omega t + \phi))(\sin(\omega t+\omega\tau + \phi))\mathrm{d}t}{-A^2\omega^2\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*Because &amp;lt;math&amp;gt;\sin(\omega t+\phi)+ \omega\tau = \sin(\omega t +\phi)\cos(\omega\tau) + \sin(\omega\tau)\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above therefore becomes&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} [\sin(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)][\sin(\omega t +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)+\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi)\cos(\omega\tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The above will then cancel to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau) + \frac{\int_{-\infty}^{\infty}\sin(\omega\tau)\cos(\omega t + \phi)\sin(\omega t +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The function on the right hand side of the equation is odd. This means that when integrated, it will equal zero. Therefore, one final simplification can be made to produce:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega\tau)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The final result of the above was then used, with &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;, to plot the harmonic oscillator. This can be seen in graph 34. The VACFs for the liquid and the solid that were simulated above were also plotted on the same axis.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf.PNG|center|600px|thumb|Graph 34 - VACF and harmonic oscillator as a function of time]] &lt;br /&gt;
&lt;br /&gt;
The above procedure was then repeated for the system containing one million atoms, this can be seen in graph 35.&lt;br /&gt;
&lt;br /&gt;
[[File:Jmt12-vacf-million.PNG|center|600px|thumb|Graph 35 - VACF and harmonic oscillator as a function of time for 1 million particles]] &lt;br /&gt;
&lt;br /&gt;
As can be seen from graphs 34 and 35, the VACF of the solid resembles the plot of the harmonic oscillator close to &amp;lt;math&amp;gt;\tau = 0&amp;lt;/math&amp;gt; but then reaches a constant value with increasing time. The harmonic oscillator is such a consistent shape because it ignores all interactions with other particles and only experiences one single force while the particle under observation vibrates. The minima of the VACF plots represents the points where the particle changes its direction of velocity. In reality, the solid and the liquid both represent a damped harmonic oscillator because the attractive and repulsive forces they experience force the particles to settle to an equilibrium where the forces it is subjected to balance out, rather than continuously vibrating as in the harmonic oscillator. The solid suffers more oscillations than the liquid does. This is because the solid is more constricted than the liquid which means that the liquid isn&#039;t forced to oscillate as much because it is not fixed in a certain position. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was then used to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The graphs produced can be seen below as graphs 37, 39 and 41. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-solid.PNG|center|475px|thumb|Graph 36 - VACF of solid]]&lt;br /&gt;
| [[File:Jmt12-integral-solid.PNG|center|475px|thumb|Graph 37 - Running integral - solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-liq.PNG|center|475px|thumb|Graph 38 - VACF of liquid]]&lt;br /&gt;
| [[File:Jmt12-integral-liq.PNG|center|475px|thumb|Graph 39 - Running integral - liquid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-vap.PNG|center|475px|thumb|Graph 40 - VACF of vapour]]&lt;br /&gt;
| [[File:Jmt12-integral-vap.PNG|center|475px|thumb|Graph 41 - Running integral - vapour]]&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated from these integrals, as shown below;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.44x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.181&lt;br /&gt;
| 3.11&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
It would be expected that the magnitude of the diffusion coefficients would follow the trend vapour &amp;gt; liquid &amp;gt; solid. This is because the atoms in the vapour are much further away from each other, meaning diffusion can take place with ease. Diffusion coefficient of the liquid would depend on its viscosity; a more viscous liquid would have a smaller &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;. The solid would be expected to have a very small value because very limited diffusion can take place in a solid. From the above table, this is true.&lt;br /&gt;
&lt;br /&gt;
The above was then repeated for the simulated system of one million atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-solid(2).PNG|center|475px|thumb|Graph 42 - VACF of solid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-solid.PNG|center|475px|thumb|Graph 43 - Running integral - solid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-liq.PNG|center|475px|thumb|Graph 44 - VACF of liquid (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-liq.PNG|center|475px|thumb|Graph 45 - Running integral - liquid (one million)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| [[File:Jmt12-vacf-million-vap.PNG|center|475px|thumb|Graph 46 - VACF of vapour (one million)]]&lt;br /&gt;
| [[File:Jmt12-integral-million-vap.PNG|center|475px|thumb|Graph 47 - Running integral - vapour (one million)]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The below diffusion coefficients were obtained for these systems from graphs 43, 45 and 47;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
| 1.22x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.089&lt;br /&gt;
| 3.26&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These values for &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; follow the same trend as explained above.  &lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimates of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; from the VACF would come from the use of the trapezium rule for the integration. The trapezium rule is an approximation which integrates the area under a curve by splitting up the area into multiple trapeziums and summing their individual areas. However, in this calculation, a very large number of trapeziums have been used and the accuracy increases with increasing number of trapeziums, meaning that this should be a good approximation to use in this case. This is shown to be true because similar values were calculated for the diffusion coefficients using the mean squared displacement and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534088</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534088"/>
		<updated>2016-02-12T13:15:47Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s not just that there are more energy levels, it&#039;s that they are more closely spaced in energy. Therefore, to promote the system to a higher energy level (high temperature), less emergy is required. Be careful, these aren&#039;t electronic energy levels, so it&#039;s not electrons which are promoted. They&#039;re just &amp;quot;modes&amp;quot; of the system. It&#039;s not a specific idea, just an analogy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, I wouldn&#039;t connect the points by lines - this implies that there is a linear trend between the points, which there clearly isn&#039;t.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The atoms repel, not the nuclei. There are no nuclei or electrons in the simulation, just point particles. But this is a good explanation otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice explanation. Is this the lattice spacing you would expect for this density? You could also use the values A and C to work out the lattice spacing, and then take an average - you can use your diagram to work out how far those distances are.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. In fact, in the liquid, the minimum is the result of atoms colliding with their &amp;quot;solvent cage&amp;quot;&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534087</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534087"/>
		<updated>2016-02-12T13:14:56Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s not just that there are more energy levels, it&#039;s that they are more closely spaced in energy. Therefore, to promote the system to a higher energy level (high temperature), less emergy is required. Be careful, these aren&#039;t electronic energy levels, so it&#039;s not electrons which are promoted. They&#039;re just &amp;quot;modes&amp;quot; of the system. It&#039;s not a specific idea, just an analogy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, I wouldn&#039;t connect the points by lines - this implies that there is a linear trend between the points, which there clearly isn&#039;t.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The atoms repel, not the nuclei. There are no nuclei or electrons in the simulation, just point particles. But this is a good explanation otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice explanation. Is this the lattice spacing you would expect for this density? You could also use the values A and C to work out the lattice spacing, and then take an average - you can use your diagram to work out how far those distances are.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. In fact, in the liquid, the minimum is the result of atoms colliding with their &amp;quot;solvent cage&amp;quot;&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534086</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534086"/>
		<updated>2016-02-12T13:10:55Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s not just that there are more energy levels, it&#039;s that they are more closely spaced in energy. Therefore, to promote the system to a higher energy level (high temperature), less emergy is required. Be careful, these aren&#039;t electronic energy levels, so it&#039;s not electrons which are promoted. They&#039;re just &amp;quot;modes&amp;quot; of the system. It&#039;s not a specific idea, just an analogy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, I wouldn&#039;t connect the points by lines - this implies that there is a linear trend between the points, which there clearly isn&#039;t.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The atoms repel, not the nuclei. There are no nuclei or electrons in the simulation, just point particles. But this is a good explanation otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice explanation. Is this the lattice spacing you would expect for this density? You could also use the values A and C to work out the lattice spacing, and then take an average - you can use your diagram to work out how far those distances are.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534085</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534085"/>
		<updated>2016-02-12T13:07:31Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s not just that there are more energy levels, it&#039;s that they are more closely spaced in energy. Therefore, to promote the system to a higher energy level (high temperature), less emergy is required. Be careful, these aren&#039;t electronic energy levels, so it&#039;s not electrons which are promoted. They&#039;re just &amp;quot;modes&amp;quot; of the system. It&#039;s not a specific idea, just an analogy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, I wouldn&#039;t connect the points by lines - this implies that there is a linear trend between the points, which there clearly isn&#039;t.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: The atoms repel, not the nuclei. There are no nuclei or electrons in the simulation, just point particles. But this is a good explanation otherwise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Nice explanation. Is this the lattice spacing you would expect for this density? You could also use the values A and C to work out the lattice spacing, and then take an average - you can use your diagram to work out how far those distances are.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534084</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534084"/>
		<updated>2016-02-12T13:04:00Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Calculating Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: It&#039;s not just that there are more energy levels, it&#039;s that they are more closely spaced in energy. Therefore, to promote the system to a higher energy level (high temperature), less emergy is required. Be careful, these aren&#039;t electronic energy levels, so it&#039;s not electrons which are promoted. They&#039;re just &amp;quot;modes&amp;quot; of the system. It&#039;s not a specific idea, just an analogy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Again, I wouldn&#039;t connect the points by lines - this implies that there is a linear trend between the points, which there clearly isn&#039;t.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534083</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534083"/>
		<updated>2016-02-12T13:00:32Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Consider drawing the graph without the grid, it might be clearer. Also, don&#039;t just join the points up for the ideal gas equation - if you have that few points, it&#039;s fine just to show the markers. Alternatively, you could fit a function to give a smooth line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534082</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534082"/>
		<updated>2016-02-12T12:57:59Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Very nice explanation&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534081</id>
		<title>Talk:Mod:am6913LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:am6913LS&amp;diff=534081"/>
		<updated>2016-02-12T12:55:56Z</updated>

		<summary type="html">&lt;p&gt;Npj12: /* Task 6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Liquid Simulations Computational Lab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1 and 2 ===&lt;br /&gt;
In the HO.xls file, the three columns were completed.  &lt;br /&gt;
&lt;br /&gt;
&#039;ANALYTICAL&#039; showed the values for the position at time t, computed classically using the steady state equation for the harmonic oscillator &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. Here &amp;lt;math&amp;gt;A = 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially, the timestep was set at 0.1.&lt;br /&gt;
&lt;br /&gt;
The graph shown below demonstrates that the results for the above harmonic oscillator equation, shown by an blue line, agree with the results from the velocity-Verlet algorithm, shown by red dots. &lt;br /&gt;
&lt;br /&gt;
[[File:Position vs time final a micottis comparison.png|frame|center|Figure 1: Harmonic Oscillator and the Velocity-Verlet Algorithm vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ERROR&#039; calculated the absolute difference between the positions found classically in &#039;ANALYTICAL&#039; and those found using the velocity-Verlet algorithm. It can be seen in figure 2 that the error varies periodically and gets larger with time. In figure 3 the maxima of each peak were found and isolated to produce a graph following a linear function. The gradient of this line was +0.0004, reflecting the fact that the maxima gain amplitude during the trajectory. The observed trend occurs due to the fact that the velocity-Verlet algorithm is based on an iteration; as the calculation progresses, errors accumulate over time and will therefore continue to increase throughout the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs time final a micottis.png|frame|center|Figure 2: Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
[[File:Max error vs time final a micottis.png|frame|center|Figure 3: Max Error vs. Time at 0.1 Timestep]]&lt;br /&gt;
&#039;ENERGY&#039; used the equation E = ½mv&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + ½kx&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; to find the total energy of the oscillator for the velocity-Verlet solution. Since the system is approximated by a simple harmonic oscillator in which the atoms compress and extend due to the conversion between kinetic and potential energy, the total energy remains constant and there is no exchange/energy losses to the surroundings. In figure 4, we can see that the system follows a sinusoidal function that fluctuates about an average energy value of 0.499. Since at a timestep of 0.1 the fluctuations have a range of 0.0013, the energy only changes by 0.13% of the average in either direction.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good. Why do you think this is?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time final a micottis.png|frame|center|Figure 4: Energy vs. Time at 0.1 Timestep]]&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\omega = \sqrt{\frac{k}{\mu}}&amp;lt;/math&amp;gt;, you would expect that an increase in mass would result in a smaller vibration frequency (as the reduced mass would also increase) and hence a periodic function with a larger wavelength, whilst increasing the force constant, k, would have the opposite effect.&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
By changing the values of the timestep, it became clear that decreasing its value gave a smaller energy dispersion and fewer fluctuations per unit time, whilst increasing had the opposite effect. Hence, by increasing the timestep to 0.2, the total energy did not change by more than 1% over the course of the simulation; this was found by comparing 1% of the average value of the fluctuations with the difference between the maximum and minimum of the curve. At a timestep of 0.2, these values came to 0.005 and 0.00498 respectively. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system to ensure that the simulation is obeying the law of conservation of energy and fluctuates about a constant, average energy. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good &amp;lt;/span&amp;gt;&#039;&#039;&#039;Smaller fluctuations lead to a better-defined average value. &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: That&#039;s not quite true - it just means that the standard deviation is smaller.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the equation for a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;{r^{12}}&amp;lt;/math&amp;gt; is the short range repulsion and &amp;lt;math&amp;gt;{r^{6}}&amp;lt;/math&amp;gt; is the long range attraction between the two atoms.&lt;br /&gt;
&lt;br /&gt;
The separation at which the potential energy is zero was found by setting &amp;lt;math&amp;gt;\phi\left(r\right)=0 &amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; as the attraction and repulsion cancel out. &lt;br /&gt;
&lt;br /&gt;
The corresponding force was calculated by finding &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; and substituting &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i} = 4\epsilon \left({12\sigma^{12}}{r^{-13}} - {6\sigma^6}{r^{-7}} \right)&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{F}(r_0) = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The equilibrium separation was found by setting &amp;lt;math&amp;gt;\mathbf{F} = - \frac{\phi\left(r\right)}{\mathrm{d}\mathbf{r}}=0&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;r_{eq} = 2^{\frac{1}{6}}\sigma &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r^{13}}=\frac{6\sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The resulting well depth was calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{(2^\frac{1}{6}\sigma)^{12}}-\frac{\sigma^{6}}{(2^\frac{1}{6}\sigma)^{6}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left(\frac{1}{4}-\frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the following integrals were evaluated for &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon\left[-\frac{1}{11}\sigma^{12}r^{-11}+\frac{1}{5}\sigma^{6}r^{-5}\right]^{\infty}_{2\sigma}=-0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.008&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=-0.003&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Given that the density of water under standard conditions is &amp;lt;math&amp;gt;\rho=999.972 kg.m^{-3}&amp;lt;/math&amp;gt; and its molar mass is &amp;lt;math&amp;gt;M_{r}=18 g.mol^{-1}&amp;lt;/math&amp;gt;, then the number of molecules of water in 1mL is:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=1.00 g.cm^{-3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m_{H_{2}O}=1.00 g &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1.00g}{18 g.mol^{-1}}=0.056 mol&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0.056 mol * 6.022 * 10^{23} = 3.35 * 10^{22}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there were 10,000 molecules of water, they would occupy a volume of 3.0 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt;mL (by doing the reverse of the above calculation)&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Show your working for this too&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
An atom starting at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box under periodic boundary conditions will end up at point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; after the simulation has run from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt; along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Where periodic boundary conditions not adopted, then the atom would have ended at the point &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
Given that the Lennard-Jones parameters for argon are: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt;\frac{\epsilon}{k_B}= 120K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff of &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;r^{*}=\frac{r}{\sigma}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;r=1.09nm&amp;lt;/math&amp;gt; in real units. &lt;br /&gt;
&lt;br /&gt;
The well depth can be calculated using &amp;lt;math&amp;gt;\epsilon=120K*k_{B}&amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;\epsilon=1.66*10^{-21}J=1.00{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced temperature of &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; can be converted using &amp;lt;math&amp;gt;T^{*}=\frac{k_{B}T}{\epsilon} &amp;lt;/math&amp;gt; to give &amp;lt;math&amp;gt;T=180K&amp;lt;/math&amp;gt; in real units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good, this section is all correct and nicely presented.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Allocating random starting coordinates to atoms in simulations can lead to problems. If for example they are allocated points that fall very close together or overlap with one-another, the subsequent energy potentials calculated from the Lennard-Jones potential would be huge and impossible to achieve in any real system. Given that these simulations involve several thousand atoms it is highly probable that a number of the randomly generated positions will result in such a situation. For this reason, a small timestep is preferred in Lennard-Jones simulations as the simulated atoms will be moving very quickly as a result of these high repulsions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: This explanation seems a little bit muddled, but I think you&#039;ve got the idea. The large potential energy results in large forces, and large accelerations on the atoms. You would have to use a very small timestep to reproduce the dynamics of this accurately.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Given that each side of the lattice has a length of 1.07722, the volume of the unit cell will be &amp;lt;math&amp;gt;V=1.07722^{3}=1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the density can be found using &amp;lt;math&amp;gt;\rho=\frac{N}{V}&amp;lt;/math&amp;gt;, then in a simple cubic lattice containing one atom:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\rho=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, a face-centered cubic lattice contains a total of 4 atoms. If the density of this unit cell is 1.2, the the length of one side can be found using:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\left(\frac{4}{1.2}\right)^{\frac{1}{3}}=1.49&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Simple cubic vs. FCC lattices Azalea Micottis|frame|center|Figure 5: Simple Cubic and Face-Centred Cubic Lattices]]&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
For the simple cubic lattice simulation, input file specified a total of 10 X 10 X 10 unit cells, giving a total of 1000 atoms as each simple cubic unit cell contains a single atom.&lt;br /&gt;
&lt;br /&gt;
As mentioned above, a FCC lattice contains 4 atoms per unit cell. Therefore if a face-centred cubic lattice were defined rather a simple cubic lattice, the create_atoms command would produce a total of 4 x 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
Using the LAMMPS manual, the following commands could be better understood:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mass 1 1.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There is only one type of atom in the simulation, all with a mass of one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_style lj/cut 3.0&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential between a pair of atoms will be calculated. However, due to the use of a global cutoff argument, the potential cannot be found if the inter-atomic distance between the two atoms is greater than 3 units. The cut-off value can be smaller or larger than the dimensions of the simulation box. This command neglects the contribution of Coulombic interactions. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Pair_coeff * * 1.0 1.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command specifies the force field coefficient of 1.0 units for the interacting atoms, giving a situation under which the above global cutoff value can be overridden. This changes the pair_style setting by resetting cutoffs for all atom type pairs. Here, the two asterisk signify that this applies for all pairs of atoms within the lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Which coefficients?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 5 ===&lt;br /&gt;
Since both &amp;lt;math&amp;gt;X_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V_i(0)&amp;lt;/math&amp;gt; are specified, the velocity-Verlet algorithm must be adopted.&lt;br /&gt;
&lt;br /&gt;
=== Task 6 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By writing the above code, instead of simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It becomes easier to change the value of the timestep if desired. In the first version, once the first line reading &#039;variable timestep equal 0.001&#039; has been changed, the rest of the code will be instantly updated. Conversely in the second version, you would have to re-read the entire code to find every mention of the previous value for the timestep for the calculation to work.&lt;br /&gt;
&lt;br /&gt;
Specifically, the section quoted above ensures that no matter what the chosen timestep is, the same total time will always be simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;NJ: Good&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Task 7 ===&lt;br /&gt;
For the 0.001 timestep experiment, graphs showing energy, temperature and pressure vs. time were plotted. They all confirmed that the simulation reached equilibrium. All of the plots fluctuate about an average value and the gradient of the line of best fit is extremely small, of the order of 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;. From figure 9, showing the raw data, it can be seen that equilibrium was reached after a time of 0.4 since all three of the parameters reach a value mirroring that of the y-intercept in their corresponding line of best fit equations (shown in figures 6, 7 and 8). Furthermore, three zoomed-in graphs of each parameter vs. time were created to confirm this.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 6: Energy vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Temperature vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 7: Temperature vs. Time at 0.001 Timestep]]&lt;br /&gt;
[[File:Pressure vs time no zoom azalea micottis liquid simulations.png|frame|center|Figure 8: Pressure vs. Time at 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | [[File:FINAL FINAL raw raw data 0.001 timestep azalea micottis]]&lt;br /&gt;
! [[File:Energy time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Temperature time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Pressure time zoom azalea micottis liquid simulations.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 9: Raw Data and Zoomed E, T and P vs. Time at 0.001 Timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next, an energy vs. time plot was made for all five different timestep experiments:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Energy vs time five systems micottis.png]]&lt;br /&gt;
! [[File:Zoom Energy vs time five systems micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 10: Energy vs. Time for all Five Timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The longest timestep value of 0.015 shows an inconsistent result in that the simulation does not reach equilibrium and the energy is shown to gradually increase. The next four timestep values show much better results, with the two shortest 0.0025 and 0.001 fluctuating around the lowest energy value.&lt;br /&gt;
&lt;br /&gt;
It can be concluded that a shorter timestep is necessary for simulations using the Lennard-Jones potential to establish an equilibrium with accurate results, as suggested in task 1. On the other hand, there comes a point where decreasing the timestep provides no additional benefits as a minimum energy is reached and a smaller timestep will only inhibit the simulation as the calculations take longer. In fact, the zoomed energy vs. time graph in figure 10 shows that a timestep of 0.0025 appears to fluctuate less than a timestep of 0.001 suggesting a more accurate average. &lt;br /&gt;
&lt;br /&gt;
Overall, the 0.01 timestep is the largest to give acceptable results however 0.0025 is probably a better choice to obtain a set of more accurate results. On the other hand, the 0.015 timestep gives inaccurate results and an average is not reached.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The temperatures chosen for the calculation are all above the critical temperature to ensure the simulation of a simple liquid and not a mixture of gas and liquid phases: T&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 1.5, T&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 2.0, T&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 2.5, T&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 4.0, T&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 6.0. &lt;br /&gt;
&lt;br /&gt;
The pressures chosen are based on the simulations run previously: P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5, P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3.0&lt;br /&gt;
&lt;br /&gt;
The timestep chosen was t = 0.0025&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
In order to find the equation for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, we must start with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 =\frac{\gamma^{2}}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{2\gamma^{2}}{2}*\frac{3}{2}Nk_{B}T=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
Looking at the command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any defined thermodynamic property. The numbers that follow (Nevery, Nrepeat, and Nfreq arguments) specify on what timesteps the input values will be used in order to contributeto the average:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100 (Nevery)&#039;&#039; gives the number of timesteps that must pass before a sample value is taken to find an average. It must be a non-zero number. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000 (Nrepeat)&#039;&#039; gives the number of samples that the final average comprises.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100,000 (Nfreq)&#039;&#039; and any of its multiples are the timesteps that generate the final averaged quantities. It must be a multiple of Nevery, and Nrepeat*Nevery cannot exceed Nfreq.&lt;br /&gt;
&lt;br /&gt;
Hence there will be a sample taken every 100 timesteps, 1000 times until the data points reach a timestep of 100,000. Given that the timestep of the simulation was set to 0.0025, then 0.0025*100,000 = 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The density vs. temperature graph for the ten simulations is shown below for P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 2.5 and P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 3. The error from both of these simulations was very small, shown by the tiny error bars in both the x and y directions. The two additional lines above the two experimental lines represent the value of the density at each pressure calculated using the ideal gas equation (k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 1 in reduced units): &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs. pressure 10 repeats 2.5 3 azalea micottis|frame|center|Figure 11: Density vs. Temperature for P = 2.5 and P = 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density in both simulations is lower than the calculation. This can be explained by the fact that in the above equation we are looking at an ideal gas with no interactions between particles and therefore a potential energy of zero, whereas the simulations involve the calculation of the Lennard-Jones potential which, as discussed, considers the potential energy between two atoms. Hence there are attractive and repulsive terms between atoms that must be considered. As a result, the atoms in the simulation are located further from each other due to the Lennard-Jones potential between them and in turn this reduces the density. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the difference between the simulation and calculated density for P = 2.5 is smaller than at P = 3. Increasing pressure pushes particles closer together, so in an ideal gas the lack of interaction between the atoms mean they can move closer together quite easily. On the other hand, in the simulation the smaller interatomic distances lead to higher repulsive forces and hence the density at P = 3 is only slightly larger than at P = 2.5.&lt;br /&gt;
&lt;br /&gt;
At higher temperatures, the difference between the simulated and calculated densities appears to converge. This occurs as a result of increased thermal motion; the atoms in the simulated liquid possess a higher kinetic energy which overrides repulsive forces between atoms, overall resulting in its behaviour becoming more ideal-like.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities using Statistical Physics ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
In statistical thermodynamics, the system is thought to fluctuate about an average equilibrium state. For example, if the temperature of the system is held &#039;constant&#039; then the total energy must be fluctuating. The magnitude of the fluctuations in energy enable the heat capacity of the system to be determined and analysed. The equation for the heat capacity in the canonical ensemble is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numerator of the fraction contained in the equation above corresponds to the variance in the energy, &amp;lt;math&amp;gt;\sigma^{2}&amp;lt;/math&amp;gt; and N represents the total number of atoms in the system. The variance is the square of the standard deviation, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, and is proportional to the fluctuations. In turn, the standard deviation is proportional to &amp;lt;math&amp;gt;\frac{1}{\sqrt{N}}&amp;lt;/math&amp;gt;, telling us that a system containing a larger number of molecules will give smaller fluctuations and therefore a more accurate, better-defined average energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shown below is a plot of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; as a function of temperature at two different densities, 0.2 and 0.8. The temperature ranges between 2.0 and 2.8. The graph follows the expected trend for an extensive property, where a higher density gives a higher value for &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; since a system containing more particles requires more energy to increase the temperature of the system. The graph also shows a negative gradient in both cases despite the fact that with increasing temperature, the number of accessible energy levels is supposed to increased. This trend is perhaps arising from the fact that at higher temperatures the excited states are already occupied by electrons, making it less energetically favourable for further occupation to occur; overall, the transfer of heat to the system becomes more facile.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs temp 0.2 0.8 density azalea micottis|frame|center|Figure 12: Cv_V vs. Temperature]]&lt;br /&gt;
&lt;br /&gt;
The following input script was used for the simulations (in this case, density = 0.2 and temperature = 2.0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2 &lt;br /&gt;
&lt;br /&gt;
lattice sc ${d} &lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15 &lt;br /&gt;
&lt;br /&gt;
create_box 1 box &lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ### &lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 &lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0 &lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### &lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ### &lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ### &lt;br /&gt;
&lt;br /&gt;
timestep ${timestep} &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ### &lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press &lt;br /&gt;
&lt;br /&gt;
thermo 10 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ### &lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ### &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ### &lt;br /&gt;
&lt;br /&gt;
run 10000 unfix nve reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ### &lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100 &lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000 &lt;br /&gt;
&lt;br /&gt;
reset_timestep 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ### &lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve &lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density &lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal &lt;br /&gt;
&lt;br /&gt;
variable energy2 equal etotal*etotal &lt;br /&gt;
&lt;br /&gt;
variable temp equal temp &lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energy v_energy2 &lt;br /&gt;
&lt;br /&gt;
run 100000 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[2] &lt;br /&gt;
&lt;br /&gt;
variable aveenergy2 equal f_aves[3] &lt;br /&gt;
&lt;br /&gt;
variable Cv_V equal (((atoms)^2)*(f_aves[3]-(f_aves[2])^2))/(vol*((f_aves[1])^2)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Cv_V ${Cv_V}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
The radial distribution function of a solid, liquid and gas in a Lennard-Jones system were found. The parameters used are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas&#039;&#039; &amp;lt;math&amp;gt;\rho=0.05&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid&#039;&#039; &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a simple cubic unit cell&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid&#039;&#039; &amp;lt;math&amp;gt;\rho=1.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=1.2&amp;lt;/math&amp;gt; in a FCC unit cell&lt;br /&gt;
&lt;br /&gt;
[[File:Solid liquid gas RDF graph azalea micottis.png|frame|center|Figure 13: RDF of Solid, Liquid and Gas]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function describes how density varies as a function of distance from a chosen particle in a system. Since it provides an average structure, it is a very good representation of a system; it doesn&#039;t just consider a single snapshot with &#039;instantaneous&#039; disorder as it takes into the account the time. In all three cases above, the RDF only increases at an interatomic distance of about 0.9. Any smaller distances give an RDF of zero as at this distance the nuclei repel each other much too strongly to be placed so close together. The amplitude of the first peak for each curve is tallest in a solid and shortest in the gaseous system, as the particles are more densely packed in a solid relative to a gas.&lt;br /&gt;
 &lt;br /&gt;
The gas RDF shows a single peak at around r = 1. Since this single peak is broad we can reason that a gas has a large amount of disorder. There is neither short range nor long range order in the system. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF shows three peaks that decrease in amplitude with increasing separation. The peaks are less broad than in a gas and regularly spaced, suggesting a more ordered system. The presence of more than one peak indicates that the atoms pack around each other in &#039;shells&#039;, with the decreasing amplitude corresponding to the random Brownian motion of particles, leading to a decrease in order  with an increase in separation. Due to the fact that the oscillations die away relatively quickly, it would suggest that only short range order is present in the system (specifically, between the first three nearest neighbours).&lt;br /&gt;
&lt;br /&gt;
The solid RDF shows many sharp peaks that initially decrease in amplitude, and then a series of smaller fluctuating peaks through the remainder of the simulation. Since the peaks are sharp and narrow we know that the system is rigid and the atoms are strongly held in position and is therefore overall the most ordered system. The first three peaks can be related to specific lattice sites in the FCC unit cell upon which the simulation was based; A is the shortest distance and represents the tallest peak in the RDF whilst C is the largest distance and represents the third smaller peak. B represents the middle peak in the RDF, giving a lattice spacing of 1.475. Furthermore, the system appears to have both short and long range order due to the three large peaks (short) and the smaller fluctuating peaks (long).  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:RDF of solid simulation azalea micottis final.png]]&lt;br /&gt;
&lt;br /&gt;
! [[File:Lattice points FCC in RDF azalea micottis.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Figure 14: Lattice Sites Contributing to the RDF in FCC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The figure below shows the RDF integral vs distance for the solid system. The graph enables the coordination number of the three peaks to be determined since each point of inflection corresponds to a different coordination sphere. A central atom in a cluster of eight FCC unit cells will be neighbouring 12 atoms type A, so the first point of inflection corresponds to this point. Next, the central atom will be neighbouring 6 atoms of type B, corresponding to the second point of inflection given that 18-12 = 6. Finally, the central atom will be neighbouring 24 atoms of type C, and follows that this coordination sphere corresponds to the final point of inflection.&lt;br /&gt;
&lt;br /&gt;
[[File:Solid rdf integral azalea micottis.png|frame|center|Figure 15: RDF integral of Solid]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
Using the liq.in file provided, three simulations were run for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
The mean squared displacement, MSD, is a measure of the deviation in the distance between a moving particle and another reference particle. It can be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;MSD(\tau)=&amp;lt;r^{2}(\tau)&amp;gt;=&amp;lt;[r(t+\tau)-r(t)]^{2}&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be defined using this equation for the mean squared displacement:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots of MSD vs. timestep of the three simulations mentioned previously are shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:Msd timestep gas graph final azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:Gas msd timestep final zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Liquid msd time final liq sim azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:Final solid FCC msd vs timestep azalea micottis final.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 15: MSD vs. Timestep Plots for a Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first two plots show the variation of the MSD with timestep when looking at a gaseous system. It can be seen that initially, the graph follows a parabolic relationship due to the fact that at the beginning of a simulation the gas atoms are placed at random, far from one-another. As a result there are fewer collisions between the atoms and interactions are small, overall resulting in each atom travelling at a constant velocity. At a constant velocity, the distance travelled per unit time is constant, so from the MSD equation above it follows that &amp;lt;math&amp;gt;MSD\propto t^2&amp;lt;/math&amp;gt;. At a larger timestep, however, collisions become more frequent and the graph becomes linear to represent the Brownian motion of the gas particles. The second plot looks at the linear section in isolation, beginning on the 2000th timestep. This gave a more accurate value for the gradient and the value of &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; increased from 0.98071 to 0.99833.&lt;br /&gt;
&lt;br /&gt;
The third plot looks at a liquid system. It shows a strong linear relationship and a &amp;lt;math&amp;gt;R^{2}&amp;lt;/math&amp;gt; value of 0.9991. As discussed above this reflects the Brownian motion of the particles in the system, however since the particles in a liquid are much closer together than in a gas there is no preceding parabolic relationship. &lt;br /&gt;
&lt;br /&gt;
Finally, the last plot for the solid crystal system shows a sharp increase to a MSD of about 0.02 and then fluctuates about that value for the rest of the simulation. This result occurs due to the fact that the atoms in the solid unit cell are strongly held in place; there is a limited amount of space available for them to move in and hence the value of the MSD has a small, finite value. &lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.03&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=5.83*10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, the largest diffusion coefficient is calculated for the gaseous system as the less dense system has much more space in which the particles can move around each other. Conversely, the solid system is very rigid and closely packed, resulting in a very small diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:1 million atoms gas msd timestep azalea micottis.png|453x453px]]&lt;br /&gt;
! [[File:1 million gas msd vs timestep zoom azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million liquid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:1 million solid msd vs timestep azalea micottis.png|453x453px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 16: MSD vs. Timestep Plots for a Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen that increasing the number of atoms didn&#039;t make any changes to the overall simulation. The only noteable change could be the smoothing in the fluctuations for the solid system. Hence it can be concluded that increasing the number of atoms by such a large amount is not necessary for these kinds of calculations.&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=\frac{1}{6}*\frac{0.0364}{0.002}=3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=8.30*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.16*10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
From previously: &amp;lt;math&amp;gt;x=Acos(\omega t+\phi)&amp;lt;/math&amp;gt; and so: &amp;lt;math&amp;gt;v=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi)\times-A\omega sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}(-A\omega sin(\omega t+\phi))^{2}dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi)\times sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)cos(\omega\tau)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt} + \frac{\int_{-\infty}^{\infty} cos(\omega t+\phi)sin(\omega\tau)sin(\omega t+\phi)dt}{\int_{-\infty}^{\infty} sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt; is a constant, it can be removed from the first integral and the two &amp;lt;math&amp;gt;sin^2(\omega t+\phi)&amp;lt;/math&amp;gt; integrals cancel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)+sin(\omega\tau)\times\frac{\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t +\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the final fraction containing the two trigonometric integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}cos(\omega t+\phi)sin(\omega t+\phi) \rightarrow 0&amp;lt;/math&amp;gt;. This is because &amp;lt;math&amp;gt;cos(\omega t+\phi)sin(\omega t+\phi)&amp;lt;/math&amp;gt; gives an odd function which is a combination of the even cosine function and the odd sine function, and therefore oscillates evenly about the x-axis. Hence as long as the limits of the integral are equal and opposite the area will be exactly zero. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt \rightarrow \infty&amp;lt;/math&amp;gt;. This is because a &amp;lt;math&amp;gt;sin^{2}(x)&amp;lt;/math&amp;gt; function always has positive y-values. Hence as the limits increase to infinity, so will the area. &lt;br /&gt;
&lt;br /&gt;
So: &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, on the same graph the harmonic oscillator VACF derived above and the VACF for the previous liquid and solid simulations were plotted between a timestep of 0 and 500. &lt;br /&gt;
&lt;br /&gt;
[[File:VCAF solid liquid HO final azalea micottis.png|frame|center|Figure 17: VACF vs. Timestep Plots for a Lennard-Jones Solid and Liquid, and the Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, at the minima observed for the two Lennard-Jones calculations there is a maximum difference between &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt;, reflecting the fact that the atoms are colliding and changing direction. The solid system shows a more negative value at this point as the interatomic forces are larger than they are in a liquid. Conversely, the points preceding these minima both give a maximum peak as at a timestep of zero, &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t+\tau)&amp;lt;/math&amp;gt; have the same value.&lt;br /&gt;
&lt;br /&gt;
For the solid VACF a series of further oscillations of decreasing amplitude reflect the very ordered lattice that the atoms occupy, because these atoms are strongly held in place they can oscillate back and forth but since the system is not perfect the oscillations will eventually die away. The liquid VACF shows just one minimum due to the fact that atoms only interact with their direct neighbours and no further. &lt;br /&gt;
&lt;br /&gt;
Both of these trends vary hugely from that of the VACF found for the harmonic oscillator, which shows a periodic function with no signs of decay. This is because the approximations in this system assume no energy loss as there is nothing for the harmonic oscillator to collide with. As a result, the velocity of the system does not get smaller.&lt;br /&gt;
&lt;br /&gt;
Below is the VACF vs. timestep graph for a gas. This system exhibits no obvious oscillatory behaviour in the VACF throughout the simulation as the atoms are far apart and interact very weakly. This results in a much slower and gradual de-correlation in the velocity compared to the other more dense systems.&lt;br /&gt;
&lt;br /&gt;
[[File:VCAF gas system final azalea micottis.png|frame|center|Figure 18: VACF vs. Timestep Plot for a Lennard-Jones Gas]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4 ===&lt;br /&gt;
The trapezium rule was used to find the running integral under the VACF curves in the solid, liquid and gas simulations, shown in figure 19.  &lt;br /&gt;
&lt;br /&gt;
Since the diffusion coefficient can also be defined by:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then these graphs can be used to calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; by taking the point where the VACF integral reaches a plateau, hence the corresponding y-value provides the total integral of the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for liquid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
! [[File:VACF for solid azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 19: VACF integral of Solid, Liquid and Gas&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient was calculated for each system:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.29&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.78*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=1.84*10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same plots were calculated for the same systems with 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
! [[File:VASF for gas 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for liquid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
![[File:VACF for solid 1 million azalea micottis.png|484x484px]]&lt;br /&gt;
|-&lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; |Figure 20: VACF integral of Solid, Liquid and Gas (1 Million Atoms)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value of the diffusion coefficient for each system is almost identical to previously:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Gas:&#039;&#039; &amp;lt;math&amp;gt;D=3.27&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Liquid:&#039;&#039; &amp;lt;math&amp;gt;D=9.01*10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Solid:&#039;&#039; &amp;lt;math&amp;gt;D=4.55*10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calculated values follow the trend observed the diffusion coefficients in task 2 when using the mean squared displacement approach, with the gaseous system giving the largest value of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; and the solid system having the smallest. Once again, increasing the number of atoms doesn&#039;t have any significant effect on the value of the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Despite both methods followed in calculating this coefficient provided results with similar values and approximately within the same order of magnitude, there are still a couple of discrepancies worth explaining, especially in the solid system. Given that this method used the trapezium rule to integrate the non-periodic VACF curves, errors are likely to have accumulated with time. However, the accuracy of the VACF method could be improved by either adopting a different method of integration or using a smaller trapezium. In this second option, however, it would be necessary to adopt a smaller timestep in the simulations. As discussed previously this is not always convenient as a shorter timestep takes longer to calculate.&lt;/div&gt;</summary>
		<author><name>Npj12</name></author>
	</entry>
</feed>